UpdateRole
Change permissions on an existing role.
Requires access_control.update permission. No input or output blobs are used.
Parameters
Parameter | Type / required | Default and behavior |
|---|---|---|
| string / required | Existing role name; no default. |
| object / optional | Omitted: unchanged. Only supplied Boolean CRUD fields change. |
| object / optional | Omitted: unchanged. Only supplied Boolean CRUD fields change. |
| object / optional | Omitted: unchanged. Only supplied Boolean CRUD fields change. |
Details
Each permission object accepts optional Boolean create, read, update, and delete fields. Omitted fields and empty permission objects leave existing values unchanged. Set a field explicitly to false to revoke it. See Permission objects for the permission categories.
Response and recovery
Success returns status: 0. Use GetRoles with the relevant category flags enabled to verify the updated permissions.
Failure or empty result | Cause and recovery |
|---|---|
| The role must exist. Inspect it with GetRoles or create it first. |
See Responses for validation, authentication, and permission error envelopes. Command errors use a negative status and an info message.
This operation changes access metadata during response processing. See Error phases and retrying writes before retrying a mixed query after a response or connection failure.
Examples
Add permissions to update and delete objects and to create indexes to the “researcher” role:
[{
"UpdateRole": {
"name": "researcher",
"objects": {
"update": true,
"delete": true
},
"indexes": {
"create": true
}
}
}]
Result from a successful update:
[{
"UpdateRole": {
"status": 0
}
}]
Remove permissions to create objects and to read access_control to the “architect” role:
[{
"UpdateRole": {
"name": "architect",
"objects": {
"create": false
},
"access_control": {
"read": false
}
}
}]
Result from a successful update:
[{
"UpdateRole": {
"status": 0
}
}]