Permission
- 04 Jul 2022
- 2 Minutes to read
- Print
- DarkLight
Permission
- Updated on 04 Jul 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Permission
Permissions
- Permissions ManageGET global/agents/{agentId}/permissions
- Get agent PermissionsGET global/agents/{roleId}/permissions
- Get role PermissionsGET global/permissions
- Get the list of PermissionsGET global/permissions/{id}
- Get a single PermissionPUT global/agents/{agentId}/permissions
- Update agent PermissionsPUT global/roles/{roleId}/permissions
- Update role Permissions
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 | Name 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. |
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://api11.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://api11.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://api11.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://api11.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://api11.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://api11.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
]
}
Was this article helpful?