Retrieving User Roles By User ID¶
This operation can be used to retrieve custom and system roles assigned 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.
||Unique identifier of the user account to retrieve all roles assigned to the user.|
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.
Returns a list containing all roles associated with the user.
Consider the following record in the
Users data table:
The example below retrieves all roles of the user
"firstname.lastname@example.org" associated with the
The output will look as shown below after the Codeless logic runs: