Replies: 2 comments 2 replies
-
https://laravel.com/docs/10.x/authorization#policy-methods |
Beta Was this translation helpful? Give feedback.
1 reply
-
Ok i managed to get it working. I understood that can() checks first for role then permission then policy. But in order to match permission with policy, the permission naming has to be like [policy method name]-[policy/model name]. Why in the spatie documentation the permission names are like: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am new to laravel and the custom packages that other people develop. As i was checking what laravel-permission can do, I didnt find anywhere how it deals with the situation that only an owner of a particular object (ex. a post) can edit and delete it and not a role of editor. If a user has a the role 'Editor' that can create, edit and delete contradicts the user that can only edit and delete their own posts. The solutions i found were still using the guard-policy techniques which are offered by default with laravel. So how can only roles have permissions? Is there anything i miss or didnt understand?
Beta Was this translation helpful? Give feedback.
All reactions