$hasAnyRole
Checks if a user has one of the given roles. Returns true
or false
.
Usage
$hasAnyRole[userID;roleID1;roleID2;...]
- userID - (Optional) default value:
$authorID
. If not included or left empty, $authorID will be used. - role N - You can add as many roles as needed.
Example
Using $hasAnyRole
How to use $hasAnyRole without user argument. Keep in mind that if the user does have only one 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.