userRoles

To return the role of a given user

Get back all roles the current or a given user is assigned to in a workspace (team) with this function. The result is an array with the role names.

Syntax

userRoles()

userRoles(user)

Return

[string]

Examples

userRoles() To return all roles of the current user.

userRoles()

Result: admin, Leadership Team, World Savior (if Captain America is processing this function, and admin, as well as Leadership Team and World Savior, are assigned roles)

userRoles(myUser) To return all roles of a given user.

Choose the field User and select Steve Rogers.

userRoles(User)

Result: admin, Leadership Team, World Savior (if Captain America is selected in the field User, and admin, as well as Leadership Team and World Savior are assigned roles).

See also

user, which returns the current or a specific user.

userHasRole, which returns Ja (true) if a user has a given role.

userRole, which returns the role of a user.

Last updated