Zabbix Documentation 2.2

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

manual:api:reference:usergroup:massadd

usergroup.massadd

Description

object usergroup.massadd(object parameters)

This method allows to simultaneously add permissions and users to multiple user groups.

Parameters

(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.

Return values

(object) Returns an object containing the IDs of the updated user groups under the usrgrpids property.

Examples

Denying access to host group

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:

{
    "jsonrpc": "2.0",
    "result": {
        "usrgrpids": [
            "17",
            "19"
        ]
    },
    "id": 1
}

See also

Source

CUserGroup::massAdd() in frontends/php/api/classes/CUserGroup.php.