-
Notifications
You must be signed in to change notification settings - Fork 335
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
Simplify handling of owning model (performance) #319
Comments
This is actually on the roadmap. Not just for owning models, but for all abilities. |
I'm closing this for now. It's on my list of things to get done. I don't want it to clutter up the issues here. I'll also post an update to this (closed) issue when this feature will be implemented. |
Just pushed this update to master: Bouncer::allowEveryone()->to('view', Post::class); or to own: Bouncer::allowEveryone()->toOwn(Post::class)->to('view'); ...or any other ability types. To test this:
Now you're ready to play around with these new methods: Bouncer::allowEveryone()->to(...);
Bouncer::disallowEveryone()->to(...);
Bouncer::forbidEveryone()->to(...);
Bouncer::unforbidEveryone()->to(...); Please test it, and let me know your findings 👍 |
At the moment, when you do:
This will allow that particular user to own a post. If you have millions of users and want them to own posts, it will add a million records into your
permissions
table just for them to be able to own their own posts.It would be cool if you could grant permission to a general user class to own their own post models:
Where this would create only 1 permission record in the database and still allow any users to own their own posts.
The text was updated successfully, but these errors were encountered: