Checks if a user has the required role.
The roles assigned to the user.
The role required for the action.
True if the user has the required role, false otherwise.
hasRole(["admin", "editor"], "admin"); // truehasRole(["viewer"], "editor"); // false Copy
hasRole(["admin", "editor"], "admin"); // truehasRole(["viewer"], "editor"); // false
Checks if a user has the required role.