user-management
user-management copied to clipboard
hasRole() function doesnt work with children roles
Lets say we have two roles: department-boss role and director role, whose child is the department-boss role. In that scenario, ill expect the function hasRole('department-boss') returns true when im logged in like a user that has director role, but its returns false. I saw that in the session __userRoles only shows [0 => 'director'] too.
Is there any other way to query for child roles or is it just a bug?