A MoogDb v2 method that returns the roles of a user.
Back to MoogDb V2 API Method Reference.
Method getUserRoles
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| Number | No, if you use | A valid user ID. |
| String | No, if you use | A valid username. |
Method getUserRoles
returns the following response:
Type | Description |
---|---|
JSON Object | A JavaScript object containing the role IDs, role names and role descriptions for the specified user. |
The following examples demonstrate typical use of method getUserRoles
:
Example request to return the user roles for user ID 6:
var cevent = moogdb.getUserRoles(6);
Example response returning the roles of the specified user:
[{
"id": 1,
"name": "Super User",
"description": "Super User"
},
{
"id": 3,
"name": "Manager",
"description": "Manager"
},
{
"id": 4,
"name": "Operator",
"description": "Operator"
}]