Skip to content

hasRole etc not taking into account the team_id #2136

Answered by erikn69
tonypartridger asked this question in Q&A
Discussion options

You must be logged in to vote

Maybe you preload the roles relation before setPermissionsTeamId

Try this

$user->unsetRelation('roles');
setPermissionsTeamId($theTeamId);
$hasRole = $user->hasRole('my_role');

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tonypartridger
Comment options

Answer selected by tonypartridger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants