Changing permissions

The permission action makes changes to a user group’s permissions. Users inherit permissions from their user group. There is an additional field used with the permissions action in the user API:

json
An array of permissions each contains a usergroup identifier (name or ID), the security code, and permission type to be modified.

Expected JSON object:

{
 "permissions": {
     "add": [
         {
             "usergroup_name": "Dashboarders",
             "permission_type": "gadget",
             "seccode": "lLabelCPU"
         }
     ],
     "remove": [
         {
             "usergroup_name": "ReadOnlyReporters",
             "permission_type": "plixer",
             "seccode": "allGadgets"
         }
     ]
 }
}

JSON object returned:

{
 "data": {
     "errors": [],
     "updated": [
         "Added gadget permission lLabelCPU to usergroup 26 ",
         "Removed plixer permission allGadgets from usergroup 27 "
     ]
 }
}
Field Description
data An array of responses for each permission change updated or attempted
updated Messages for any sucessful changes to permissions
errors An array of errors explaining why the permission change failed

Example API call

curl --location --insecure --request POST '{{scrutinizer}}/fcgi/scrut_fcgi.fcgi' \
 --form 'authToken={{authToken}}' \
 --form 'rm=user_api' \
 --form 'action=permissions' \
 --form 'json=
 {
     "permissions": {
         "add": [
             {
                 "usergroup_id": 23,
                 "permission_type": "plixer",
                 "seccode":   "statusTab"
             }
         ],
         "remove": []
     }
 }'