[POST] .../v1/role/add
Adds new role. Use this method to create a new RBAC role before assigning permissions through RolePermission/Edit and assigning the role to users or groups. The method validates name, checks role add permission 10, checks that the tariff allows role creation, inserts the role, writes an action log record and returns new_id. The request body is required, name must be provided and must not exceed 50 characters and description is optional with a maximum length of 300 characters. Missing body, missing or too long name, denied permission, disabled tariff option, duplicate role data and database errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| description | String | Optional | Note. |
| name | String | Required | Role name. |
Request Example
{
"name": "Cashier",
"description": "POS operator role"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 4
}
}