Assigning a Role to a User¶
This operation assigns a new role to a user.
This functionality can be used only in CloudCode (Java, JS or Codeless), the reason for this restriction is that a malicious use of this API can easily compromise application's security. As a result, this API must be used from a controlled environment. For information about the API select either Android/Java or JS documentation.
CloudCode Codeless Reference¶
||A value for a column in the
||The name of а role that must be assigned.|
This Codeless block is only available in CloudCode due to the security reasons. If this operation is exposed to users, then your application can be compromised.
This operation does not return a value.
Consider the following record in the
Users data table:
Suppose, the identity
"firstname.lastname@example.org" has the following assigned roles:
The example below assigns a new role
"Team Leader" to the
The result of this operation is a new assigned role
"Team Leader" :