usergroup.massupdate
Description
object usergroup.massupdate(object parameters)
This method allows to simultaneously update properties, users or permissions for multiple user groups.
Parameters
(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. |
Return values
(object)
Returns an object containing the IDs of the updated user groups under the usrgrpids
property.
Examples
Changing permissions for a user group
Update the permissions for two user groups to only allow read-write access to two host groups.
Request:
{ "jsonrpc": "2.0", "method": "usergroup.massadd", "params": { "usrgrpids": [ "17", "19" ], "rights": [ { "permission": 3, "id": "2" }, { "permission": 3, "id": "3" } ] }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": { "usrgrpids": [ "17", "19" ] }, "id": 1 }
See also
Source
CUserGroup::massUpdate() in frontends/php/api/classes/CUserGroup.php.
Data source: Zabbix