--- title: "Permission" slug: "server-api-global-setting-permission" updated: 2022-07-04T06:33:28Z published: 2022-07-04T06:33:28Z canonical: "developer.comm100.com/server-api-global-setting-permission" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Permission ## Permission - `Permissions` - Permissions Manage - `GET global/agents/{agentId}/permissions` - [Get agent Permissions](/docs/server-api-global-setting-permission#get-agent-permissions) - `GET global/agents/{roleId}/permissions` - [Get role Permissions](/docs/server-api-global-setting-permission#get-role-permissions) - `GET global/permissions` - [Get the list of Permissions](/docs/server-api-global-setting-permission#get-the-list-of-permissions) - `GET global/permissions/{id}` - [Get a single Permission](/docs/server-api-global-setting-permission#get-a-single-permission) - `PUT global/agents/{agentId}/permissions` - [Update agent Permissions](/docs/server-api-global-setting-permission#update-agent-permissions) - `PUT global/roles/{roleId}/permissions` - [Update role Permissions](/docs/server-api-global-setting-permission#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](/docs/server-api-global-setting-permission#permission-json-format) - #### 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: [Permission](/docs/server-api-global-setting-permission#permission-json-format) - #### 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 ] } ```