-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto-loading, auto-saving feature #194
Comments
@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 |
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. |
auto-loading:
https://github.com/casbin/casbin/blob/2ab8eb7c140a19a2687c7b0a14331756242c5741/enforcer_synced.go#L55-L83
auto-saving:
This is an unimplemented feature in casbin golang & casbin-rs, it can be used for FileAdapter for example.
The text was updated successfully, but these errors were encountered: