usergroup.update

说明

object usergroup.update(object/array **userGroups**)

此方法允许更新现有的用户组。

Description

object usergroup.update(object/array **userGroups**)

This method allows to update existing user groups.

参数

(object/array)要更新的用户组属性。

必须为每个用户组定义“usrgrpid”属性,所有其他属性都是可选的。 只有通过的属性将被更新,所有其他属性将保持不变。

除了标准用户组属性之外, 该方法接受以下参数。

属性类型说明
rightsobject/array更改分配给用户组的当前权限的权限。
tag_filtersarray基于标记的权限以分配给组。
useridsstring/array用户的ID替换组中的用户。

Parameters

(object/array) User group properties to be updated.

The usrgrpid property must be defined for each user group, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Additionally to the standard user group properties, the method accepts the following parameters.

ParameterTypeDescription
rightsobject/arrayPermissions to replace the current permissions assigned to the user group.
tag_filtersarrayTag based permissions to assign to the group
useridsstring/arrayIDs of the users to replace the users in the group.

返回值

(object) 返回包含“usrgrpids”属性下更新的用户组的ID的对象。

Return values

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

示例

禁用用户组

禁用用户组。

Examples

Disabling a user group

Disable a user group.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "usergroup.update",
  4. "params": {
  5. "usrgrpid": "17",
  6. "users_status": "1"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "usrgrpids": [
  5. "17"
  6. ]
  7. },
  8. "id": 1
  9. }

参考

来源

CUserGroup::update() in frontends/php/include/classes/api/services/CUserGroup.php.