Search…
Resources
Related Links
userRole
To return the role of the current or a given user
This function finds out for you, which role a user has been assigned. By default Ninox has 2 roles in stock:
  • admin
  • editor
But you can create new roles on your own and assign them to the collaborators in your workspace.
If you want to check all roles, which are assigned to a user, use userRoles().

Syntax

userRole()
userRole(user)

Return

string

Examples

userRole() To return the role of the current user.
userRole()
Result: admin (if the current user has admin rights) or editor (if the current user has editor rights.
​
userRole(myUser) To return the role of a given user.
Choose the field "User" and select "Angela Merkel".
userRole(User)
Result: chancellor (if Angela Merkel definitely has the extra created role "chancellor")

See also

​user, which returns the current or a specific user.
​userHasRole, which returns "true" if a user has a given role.
​userRoles, which returns all roles of a user.
Last modified 2mo ago
Export as PDF
Copy link