[comment]: # translation:outdated

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

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



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

`object hostgroup.propagate(object parameters)`

此方法可将权限和标记过滤器应用到主机组的所有子组。

::: noteclassic
该方法仅适用于 *Super admin* 用户类型，调用该方法的权限可在用户角色设置中撤销。
更多信息请参阅 [用户角色](/manual/web_interface/frontend_sections/users/user_roles)。
:::

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



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

`(object)` 定义所需输出的参数。

该方法支持以下参数。

|参数|[类型](/manual/api/reference_commentary#data_types)|说明|
|--|--|------|
|groups|object/array|要传播的[主机组](/manual/api/reference/hostgroup/object) 。<br><br>主机组必须定义有 `groupid` 属性。<br><br>[参数行为](/manual/api/reference_commentary#parameter-behavior):<br>- *必须*|
|permissions|boolean|设置为 "true "可传播权限。<br><br>[参数行为](/manual/api/reference_commentary#parameter-behavior):<br>- 如果未设置 "标签过滤器"，则为*必填项*|
|tag_filters|boolean|设置为 "true "可传播标签筛选器。<br><br>[参数行为](/manual/api/reference_commentary#parameter-behavior):<br>- 如果未设置 "权限"，则为*必填项*|

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



[comment]: # ({f0b30152-42ead635})
### 返回值

`(object)` 返回一个对象，其中在 `groupids` 属性下包含传播的主机组 ID。

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



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

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



[comment]: # ({bd95271f-8ec85132})
#### 将主机组权限和标记过滤器传播到其子组

将主机组权限和标记过滤器传播到其子组。

[请求](/manual/api#performing-requests)：

```json
{
    "jsonrpc": "2.0",
    "method": "hostgroup.propagate",
    "params": {
        "groups": [
            {
                "groupid": "6"
            }
        ],
        "permissions": true,
        "tag_filters": true
    },
    "id": 1
}
```

响应：

```json
{
    "jsonrpc": "2.0",
    "result": {
        "groupids": [
            "6",
        ]
    },
    "id": 1
}
```

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



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

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

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



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

CHostGroup::propagate() 在
*ui/include/classes/api/services/CHostGroup.php*.

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