Roles with team #2872
Unanswered
djurovicigoor
asked this question in
Q&A
Roles with team
#2872
Replies: 1 comment
-
First And that's not how global roles work. If in the laravel-permission/basic-usage/teams-permissions (Check super-admin example on teams) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have these roles inside DB
User with id 1 has two roles assigned, one with the team and one global.
Permission middleware is placed correctly before SubstituteBindings middleware and contains the following code;
When I try to check the team role, I get false:
$user->hasRole(RoleEnum::TEAM_MEMBER)
Before this line of code, I checked for the permission team ID with the
getPermissionsTeamId()
helper and got the correct team ID.hasRole()
method return correct response only if i load('roles')Digging deeper inside the HasRole trait, I found roles() relation and place where getPermissionsTeamId() helper is called. When I die and dump getPermissionsTeamId(), I get null.
Any help?
Beta Was this translation helpful? Give feedback.
All reactions