Permission
  • 04 Jul 2022
  • 2 Minutes to read
  • Dark
    Light

Permission

  • Dark
    Light

Article summary

Permission

Permission JSON Format

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

NameTypeDescription
idintegerId of the permission.
moduleIdstringName of the module.
namestringName of the permission.
descriptionstringDescription of the permission.
orderintegerOrder of the permission.
isEnabledForAgentByDefaultboolWhether the permission is enabled for agent by default or not.
parentIdintegerParent of the permission.

Get agent Permissions

GET global/agents/{agentId}/permissions

  • Parameters:

No Parameters

  • Response:

NameTypeDescription
permissionIdsarrayThe 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:

NameTypeDescription
permissionIdsarrayThe 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:

Permission

  • 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:

NameTypeinRequiredDescription
permissionIdsarraybodyyesThe list of permission id
  • Response:

NameTypeDescription
permissionIdsarrayThe 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:

NameTypeinRequiredDescription
permissionIdsarraybodyyesThe list of permission id
  • Response:

NameTypeDescription
permissionIdsarrayThe 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?