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.
Select Angela Merkel in the User field.
userRole(User)
Result: exChancellor (if Angela Merkel definitely has the extra created role exChancellor)
See also
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.
Reply
Content aside
- 1 mth agoLast active
- 17Views
-
1
Following