object role.update(object/array roles)
This method allows to update existing roles.
This method is only available to Super admin user type. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object/array)
Role properties to be updated.
The roleid
property must be defined for each role, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.
Additionally to the standard role properties the method accepts the following parameters.
(object)
Returns an object containing the IDs of the updated roles under the roleids
property.
Update role with ID "5", disable ability to execute scripts.
{
"jsonrpc": "2.0",
"method": "role.update",
"params": [
{
"roleid": "5",
"rules": {
"actions": [
{
"name": "execute_scripts",
"status": "0"
}
]
}
}
],
"id": 1
}
Response:
Update role with ID "5", deny to call any "create", "update" or "delete" methods.
{
"jsonrpc": "2.0",
"method": "role.update",
"params": [
{
"roleid": "5",
"rules": {
"api.access": "1",
"api.mode": "0",
"api": ["*.create", "*.update", "*.delete"]
}
}
],
"id": 1
}
Response:
CRole::update() in ui/include/classes/api/services/CRole.php.