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().
userRole()
userRole(user)
string
userRole()
To return the role of the current user.
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.
Select Angela Merkel in the User field.
Result: exChancellor (if Angela Merkel definitely has the extra created role exChancellor)
user
, which returns the current or a specific user.
userHasRole
, which returns Yes (true
) if a user has a given role.
userRoles
, which returns all roles of a user.