Search…
Resources
Related Links
userHasRole
To return "Yes" if a user has a given role
Check with this function if the current or a given user has a specific role.

Syntax

userHasRole(string)
userHasRole(user, string)

Return

boolean

Examples

userHasRole(role) To return "true", if the current user has a given role.
userHasRole("admin")
Result: Yes (if the current user has the admin role).
​
userHasRole(myUser, role) To return "true" if a given user has a given role.
userHasRole('Created by', "admin")
Result: Yes (if the creator of the selected record has the admin role).

See also

​user, which returns the current or a specific user
Last modified 8mo ago
Export as PDF
Copy link