How to remove a permission from a specific user #979
-
Hi everyone and thank you guys for the awesome job. I have ran into an issue. I will like to remove a permission from a user. This user can belong to a group and still keep the other permissions attached to that group. For example, say i have a user that belongs to the group (Staff), now the staff group grants the user permission to view the dashboard and permission to edit settings. But as a super admin, i want to remove the permission to view the dashboard from only this user. He still belongs to the Staff group so he still has the edit settings permission. Other users who belong to the Staff group can still view the dashboard and edit settings. I understand that there are two way to check permission on shield: can() and hasPermission(). If i use can(), it will always return that the user can view dashboard because they belong to the staff group. Thank you all for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Shield doesn't support this. They will always be granted the permission from their role and then the user-level permissions are on top of that. To do what you want you would need to setup a new role. Users can have more than one role, though. |
Beta Was this translation helpful? Give feedback.
Shield doesn't support this. They will always be granted the permission from their role and then the user-level permissions are on top of that.
To do what you want you would need to setup a new role. Users can have more than one role, though.