Load permission of only active role of user #1879
Replies: 2 comments 2 replies
-
Maybe you are mentioning the teams feature, where the user can change team and have different roles and permissions for each team |
Beta Was this translation helpful? Give feedback.
-
@team-vardaam You can use the custom permission check to filter active role on each user. So first go to
Here hasActiveRolePermission is a custom method you need to implement yourself. For this, inside user model
Finally, by default, register_permission_check_method is set to true in |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have multiple roles for a user in my application. I need to develop a feature where logged in user can see his roles and can switch to another role. As package loads merged permissions of assigned roles, how could i load permission of only active role?
for marking a role active for user , i am thinking of adding an extra field to
model_has_roles
table. switching to another role will make that role active for particular user. suggestions are greatly appreciated.Thank you.
Beta Was this translation helpful? Give feedback.
All reactions