object usergroup.massupdate(object parameters)
This method allows to simultaneously update properties, users or permissions for multiple user groups.
(object)
Parameters containing the IDs of the user groups to update and the properties that should be updated.
Additionally to the standard user group properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
usrgrpids (required) |
string/array | IDs of user groups to update. |
rights | string/array | Permissions to replace the current permissions assigned to the user group. |
userids | object/array | IDs of the users to replace the users in the group. |
(object)
Returns an object containing the IDs of the updated user groups under the usrgrpids
property.
Update the permissions for two user groups to only allow read-write access to two host groups.
Request:
{
"jsonrpc": "2.0",
"method": "usergroup.massupdate",
"params": {
"usrgrpids": [
"17",
"19"
],
"rights": [
{
"permission": 3,
"id": "2"
},
{
"permission": 3,
"id": "3"
}
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CUserGroup::massUpdate() in frontends/php/api/classes/CUserGroup.php.