hasRole

Description

Returns true if the user has the given role. The username and usersource parameters are optional in the client scope, but required in the gateway scope.

Syntax

hasRole( role, [username], [usersource] )

Examples
// This is an example using the default user and userSource:
hasRole("Administrator", "admin", "default")
// This is an example using the current user and default userSource in the client scope:
hasRole("Administrator")