Associate Permissions to Role

This API is used to assign/un-assign ACF permissions to a role.

URL: /role-updatePermission

Type: PUT

Parameters

Param Type Name Description Field Type
Header sessionId** (or) Token** Use either Session Id or Token received after login. String
Query Gwkey Tenant Key. Needed only in case of multi-tenant installations. String
Query gwsource** Source from which the request is triggered (for example, web, external). String
Payload roleName** Name of the role. String
Payload assignPermissionList ACF permissions to be assigned to the role. Refer to the list of possible permissions list for details. Array
Payload unassignPermissionList ACF permissions to be unassigned from the role. Refer to the list of possible permissions list for details. Array

** - Mandatory value

Note: Even if the assignPermissionList and unassignPermissionList contain invalid ACF permission text that cannot be processed, the API would still go-ahead to assign/un-assign any functions in wither list that can be processed.

Possible Response Message and Code

HTTP Code Description Response Message
400 Bad request Role name cannot be left empty or blank.
202 Accepted ACF assignment initiated for the given role.
400 Bad request Permission list cannot be empty.

Sample Request/Response

Use Case

Assign and unassign few ACF permissions to/from the role “role_1”.

Request URL

https://appviewxapi.com/avxapi/role-updatePermission?gwkey=f000ca01&gwsource=external

Request Payload
 {
 "payload": {
 "roleName": "role_1",
 "assignPermissionList": [
 "general:accounts:resource:clone",
 "general:accounts:resource:delete"
 ],
 "unassignPermissionList": [
 "general:accounts:resource:delete"
 ]
 }
 } 

Response

 {
 "response": "ACF assignment initiated for the given role",
 "message": "ACF assignment initiated for the given role",
 "appStatusCode": null,
 "tags": null,
 "headers": null
 }