Edit

[POST] .../v1/rolepermission/edit

Edits information about access permissions role. Use this batch method to allow or deny one or more permissions for non-admin RBAC roles after loading the current matrix with RolePermission/Get. The request body is required and is a JSON root array with 1 to 250 items; each item must provide value and either id or the role_id plus permission_id pair. The method rejects direct edits of the Admin role, checks role-permission edit permission 20, verifies tariff access to RBAC permission settings, writes action-log rows, invalidates chat entity access cache and returns row_affected. Missing body, an empty or oversized array, missing item identifiers, missing value, Admin role edits, denied access, disabled tariff option, unknown role-permission links, action-log errors and database errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
id Int64 Optional Role-permission record ID. Optional when both role_id and permission_id are supplied.
permission_id Int64 Optional Permission ID. Required only when id is not supplied.
role_id Int64 Optional Role ID. Required only when id is not supplied; role_id = 1 is the protected Admin role and cannot be edited.
value Boolean Required Allows or denies the permission for the role.

Request Example

[
  {
    "role_id": 4,
    "permission_id": 20,
    "value": true
  },
  {
    "id": 38,
    "value": false
  }
]

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 4
  }
}