Permission

Permissions
- Permissions Manage
GET global/agents/{agentId}/permissions
GET global/agents/{roleId}/permissions
GET global/permissions
GET global/permissions/{id}
PUT global/agents/{agentId}/permissions
PUT global/roles/{roleId}/permissions
Model
Permission JSON Format

Permission is represented as simple flat JSON objects with the following keys:

Name Type Description
id integer Id of the permission.
moduleId string Id of the module.
name string Name of the permission.
description string Description of the permission.
order integer Order of the permission.
isEnabledForAgentByDefault bool Whether the permission is enabled for agent by default or not.
parentId integer Parent of the permission.
Endpoint
Get agent Permissions

GET global/agents/{agentId}/permissions

Parameters:

No Parameters
Response:

Name Type Description
permissionIds array The list of permission id.
Example

Sample Request:

curl https://api15.comm100.io/v4/global/agents/edd568c2-9e9f-416c-b98b-17fb03c1ee52/permissions \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"permissionIds": [1,2]}
Get role Permissions

GET global/agents/{roleId}/permissions

Parameters:

No Parameters
Response:

Name Type Description
permissionIds array The list of permission id.
Example

Sample Request:

curl https://api15.comm100.io/v4/global/roles/edd568c2-9e9f-416c-b98b-17fb03c1ee52/permissions \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"permissionIds": [1,2]}
Get the list of Permissions

GET global/permissions

Parameters:

No Parameters
Response:

An array of   Permission

Example

Sample Request:

curl https://api15.comm100.io/v4/global/permissions \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

[ { "id": 1, "moduleId": "Global", "name": "Manage My Profile", "description": "• Edit My Profile", "order": 0, "isEnabledForAgentByDefault": false, "parentId": 0 } ]
Get a single Permission

GET global/permissions/{id}

Parameters:

No Parameters
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/global/permissions/1 \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{ "id": 1, "moduleId": "Global", "name": "Manage My Profile", "description": "• Edit My Profile", "order": 0, "isEnabledForAgentByDefault": false, "parentId": 0 }
Update agent Permissions

PUT global/agents/{agentId}/permissions

Parameters:

Name Type In Required Description
permissionIds array body yes The list of permission id
Response:

Name Type Description
permissionIds array The list of permission id.
Example

Sample Request:

curl https://api15.comm100.io/v4/global/agents/edd568c2-9e9f-416c-b98b-17fb03c1ee52/permissions \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"permissionIds": [1,2]}'

Response:

 HTTP/1.1 200 OK

{"permissionIds": [1,2]}
Update role Permissions

PUT global/roles/{roleId}/permissions

Parameters:

Name Type In Required Description
permissionIds array body yes The list of permission id
Response:

Name Type Description
permissionIds array The list of permission id.
Example

Sample Request:

curl https://api15.comm100.io/v4/global/roles/edd568c2-9e9f-416c-b98b-17fb03c1ee52/permissions \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"permissionIds": [1,2]}'

Response:

 HTTP/1.1 200 OK

{"permissionIds": [1,2]}