auto-loading, auto-saving feature
GopherJ opened this issue · 4 comments
auto-loading:
auto-saving:
This is an unimplemented feature in casbin golang & casbin-rs, it can be used for FileAdapter for example.
@GopherJ we already have the AutoSave feature (for a not short time): https://casbin.org/docs/en/adapters#autosave. It's an optional feature that an adapter can choose to support it or not. Doesn't Casbin-RS support such mechanism?
The built-in file adapter usually doesn't implement AutoSave, because files are mostly used as static resources and will only be loaded at initial time. A user usually doesn't want to read & write data to files. They will choose to use DB for such requirement.
@hsluoyz auto save here means more SavePolicy
instead of AddPolicy/RemovePolicy/RemoveFiltered
etc. It's more for file-adapter like csv.
Like I said, I don't think there are many people that want to save rules into CSV files as a long-term solution. Making efforts into this area would be not very fruitful, unless some important customers request this feature explicitly.
@hsluoyz I don't think there will be a great effort needed to implement this type of small thing.
currently casbin binds too tighltly with databases, that means if there is no database, then there is no persistence.
This isn't really good, because some simple use cases, users will not want to add databases.