You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if you have 3 permissions create, edit and delete and you want to know if the user has any of these permissions you have to do a if (allows() || allows() || allows()).
I suggest updating the any() method to mean any one of the provided permissions, and create an all() method to check if they have all the provided permissions. (the any() method currently works this way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel doc section - https://laravel.com/docs/8.x/authorization#gates-supplying-additional-context
Currently if you have 3 permissions
create
,edit
anddelete
and you want to know if the user has any of these permissions you have to do aif (allows() || allows() || allows())
.I suggest updating the
any()
method to mean any one of the provided permissions, and create anall()
method to check if they have all the provided permissions. (theany()
method currently works this way.Beta Was this translation helpful? Give feedback.
All reactions