$hasRoles
Checks if user has all of the given roles. Returns true
or false
.
Usage:
$hasRoles[userID;role1;role2;...]
- userID - User you want to check for roles.
- role N - You can add as many roles as needed.
Example
Using $hasRoles
How to use $hasRoles. Keep in mind that only if the user does have all of listed roles, true will be returned.
Suggestion
To make code stop if the user doesn't have the needed role, you can check out $onlyIf. For multiple actions, check $if.