[comment]: # translation:outdated

[comment]: # ({de01ad95-f9e8f670})
# hostgroup.propagate

[comment]: # ({/de01ad95-f9e8f670})



[comment]: # ({84212e5d-b5ff62ed})
### Description

`object hostgroup.propagate(object parameters)`

此方法允许将权限和标签筛选器应用于一个主机组的所有子组。

::: noteclassic
此方法仅适用于*超级管理员*用户类型。
可以在用户角色设置中撤销调用该方法的权限。
有关更多信息，请参见[User
roles](/manual/web_interface/frontend_sections/users/user_roles)。
:::

[comment]: # ({/84212e5d-b5ff62ed})



[comment]: # ({7fca88e9-6102edd8})
### Parameters
  
`(object)` 参数定义了期望的输出。

此方法支持以下参数。

|参数|[数据类型](/manual/api/reference_commentary#数据类型)|描述|
|--|--|------|
|groups|object/array|要传播的[Host groups](/manual/api/reference/hostgroup/object)。<br><br>主机组必须定义了`groupid`属性。<br><br>[参数行为](/manual/api/reference_commentary#参数行为):<br>- *必填*|
|permissions|boolean|设为"true"以传播权限。<br><br>[参数行为](/manual/api/reference_commentary#参数行为):<br>- *必填* 如果 `tag_filters` 未设置|
|tag_filters|boolean|设为"true"以传播标签过滤器。<br><br>[参数行为](/manual/api/reference_commentary#参数行为):<br>- *必填* 如果 `permissions` 未设置|

[comment]: # ({/7fca88e9-6102edd8})



[comment]: # ({f0b30152-42ead635})
### Return values
  
`(object)` 返回一个 object，其中包含传播的 主机 组的 ID，这些 ID 位于 `groupids` 属性下。

[comment]: # ({/f0b30152-42ead635})



[comment]: # ({b41637d2-018502e3})
### Examples

[comment]: # ({/b41637d2-018502e3})



[comment]: # ({bd95271f-8ec85132})
#### Propagating host group permissions and tag filters to its subgroups.

将 主机组 权限和标签筛选器传播到其子组。

[执行请求](/manual/api#执行请求):

```json
{
    "jsonrpc": "2.0",
    "method": "hostgroup.propagate",
    "params": {
        "groups": [
            {
                "groupid": "6"
            }
        ],
        "permissions": true,
        "tag_filters": true
    },
    "id": 1
}
```
Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "groupids": [
            "6"
        ]
    },
    "id": 1
}
```

[comment]: # ({/bd95271f-8ec85132})



[comment]: # ({5e0375b3-10bafee5})
### See also

-   [hostgroup.update](update)
-   [hostgroup.massadd](massadd)
-   [主机](/manual/api/reference/host/object#主机)

[comment]: # ({/5e0375b3-10bafee5})



[comment]: # ({fb50ec6c-a745b72a})
### Source
CHostGroup::propagate() 函数位于
*ui/include/classes/api/services/CHostGroup.php* 文件中。

[comment]: # ({/fb50ec6c-a745b72a})
