-
Notifications
You must be signed in to change notification settings - Fork 47
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
Should the Manager class handle multiple drivers? #3
Comments
I don't need it. Is there an exact use case? |
A use case could be local development. Where you'd easily could use the production driver with a DB implementation to your production DB to check permissions for your production environment but with a read only driver so you'd never edit your production settings. This is of course mostly for persistent drivers. Doesn't really makes sense for static drivers. I have to admit. This idea sounds far fetched with only a few use cases so I'm going to move this from the 1.0 milestone to a concept label and implement it in a future release if people ever need it. |
I think I found a valid use case. There could be some situations where you need both persistent and static drivers. I've found out in a large app that I'm maintaining I'm using both a persistent driver for user permissions on organizations and a static driver for the organization types. Will dig into this later to see if I can come up with something useful. |
Hey, just found this package. Coming from sentry (crying for sentinel being open source) this one is the heaven itself. To respond to this one as well: I think this belongs to a dependency container. Even when using multiple instances. |
@sagikazarmark Hey there! First of all, thanks for the nice words! :) You're probably right about that. I guess the developer can always choose to bind as many Manager instances as he likes into some sort of container. Closing this. |
Currently the Manager class accepts a single driver to store all permissions. I was thinking about allowing multiple drivers to be set. So some can be ready only with the
storePermission
anddeletePermission
methods not do anything on a read-only driver. But then you can do things like:This makes it easy to determine permissions locally for production settings.
Would this be a nice to have?
The text was updated successfully, but these errors were encountered: