-
Notifications
You must be signed in to change notification settings - Fork 337
Closed
Labels
Description
In our system, admins have access to do everything:
Bouncer::allow('admin')->everything();We have a user messaging system and use a MessagePolicy class to check if you are allowed to send a message to a user. In our case, we don't need the "everything" ability to grant access, even though they are an admin - we want the MessagePolicy to always fire but bouncer automatically intersects Gate::authorize('send', $message) with Bouncer granted permission via ability #18 [all abilities]
Would it be possible to have a way of telling bouncer to ignore certain abilities for one check, maybe a closure?
Bouncer::ignore('*', function() {
Gate::authorize('send', $message); // MessagePolicy will be checked and the absolute source of truth.
});Reactions are currently unavailable