Create a new role
- Updated: 2020/04/15
Create a new role
Use Create New RoleAPI to create a new role with permissions in the Control Room.
Prerequisites
- View and Manage Roles
- Users who have
view and manage roles
permissions can view, create, and manage roles. - JSON Web Token (JWT)
- All Control Room APIs require a JSON Web Token (JWT) to access the APIs. Generate an authentication token using the Authentication API. See Enterprise 11 Authentication API.
- URL:
http://<your_control_room_url>/v1/usermanagement/roles
Replace the content in the angle brackets with your Control Room URL.
- Method: POST.
- Use the Swagger definition files installed with your Control Room to test
the APIs. View the available Swagger APIs at:
http://<your_control_room_url>/swagger/
. - You can also use a REST client to complete this task.
Procedure
Note: You can also run REST requests from a command terminal. The following is a curl request
example. This example is formatted for readability. Replace the text inside the angle
brackets,
<authentication_token>
, with your authentication token.curl -X POST "http://<your_control_room_url>/v1/usermanagement/roles"
-H "accept: application/json"
-H "X-Authorization: <authentication_token>"
-H "Content-Type: application/json" -d '{
"name": "User-Role-Management",
"description": "",
"permissions": [
{
"id": 58,
"action": "myschedule",
"resourceType": "taskscheduling",
"resourceId": null
},
{
"id": 59,
"action": "managecredentials",
"resourceType": "credentials",
"resourceId": null
},
{
"id": 30,
"action": "view",
"resourceType": "devices",
"resourceId": null
},
{
"id": 97,
"action": "viewbotstore",
"resourceType": "botstore",
"resourceId": null
},
{
"id": 102,
"action": "viewuserbasic",
"resourceType": "usermanagement",
"resourceId": null
},
{
"id": 3,
"action": "createuser",
"resourceType": "usermanagement",
"resourceId": null
},
{
"id": 4,
"action": "updateuser",
"resourceType": "usermanagement",
"resourceId": null
},
{
"id": 2,
"action": "deleteuser",
"resourceType": "usermanagement",
"resourceId": null
},
{
"id": 1,
"action": "usermanagement",
"resourceType": "usermanagement",
"resourceId": null
},
{
"id": 12,
"action": "rolesmanagement",
"resourceType": "rolesmanagement",
"resourceId": null
},
{
"id": 90,
"action": "rolesview",
"resourceType": "rolesmanagement",
"resourceId": null
}
],
"principals": []
}'