object usergroup.massadd(object parameters)
This method allows to simultaneously add permissions and users to multiple user groups.
(object)
Parameters containing the IDs of the user groups to update and the permissions and users to add.
The method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
usrgrpids (required) |
string/array | IDs of user groups to update. |
rights | object/array | Permissions to assign to the user groups. |
userids | string/array | IDs of the users to add to the user groups. |
(object)
Returns an object containing the IDs of the updated user groups under the usrgrpids
property.
Deny two user groups access to host group "2".
Request:
{
"jsonrpc": "2.0",
"method": "usergroup.massadd",
"params": {
"usrgrpids": [
"17",
"19"
],
"rights": {
"permission": 0,
"id": "2"
}
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CUserGroup::massAdd() in frontends/php/api/classes/CUserGroup.php.