# 允许分类版主创建子分类

**URL:** https://meta.discourse.org/t/allow-category-moderators-to-create-subcategories/280203
**Category:** Feature
**Tags:** category-moderators
**Created:** [2023年九月26日 14:53 UTC](https://meta.discourse.org/t/allow-category-moderators-to-create-subcategories/280203 "2023-09-26T14:53:59Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2023年九月26日 21:22 UTC](https://meta.discourse.org/t/allow-category-moderators-to-create-subcategories/280203/2 "2023-09-26T21:22:08Z")

</div>

> [@jrack](#):
>
> 我们愿望清单上唯一剩下的项目是让委派版主能够在其特定的作用域类别下创建子类别。

您能提供一些关于您用例的细节吗？一个关于如何使用它的实际示例可能会有所帮助。

> [@jrack](#):
>
> 也许如果我使用正确的设置组合，它今天就能起作用

目前还不可能。限制类别创建给管理员（如果启用了“版主管理类别和组”设置，则还包括版主）的逻辑在这里：

> <https://github.com/discourse/discourse/blob/main/lib/guardian/category_guardian.rb#L6-L8>

如果该功能无法添加到 Discourse 核心代码中，我认为可以通过 Discourse 插件来实现。它需要在 `can_create_category?` 方法中添加一个额外的检查，以确保 `parent` 已设置，并且用户在 `parent` 类别中拥有版主权限。

如果插件不是一个选项，可以通过 API 来实现。本质上，系统用户将代表类别版主发出创建子类别的请求。这将相当复杂——对于您有一个外部网站作为 Discourse 论坛的 [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) 提供者的情况来说，这可能是最简单的。

---

_[View the full topic](https://meta.discourse.org/t/allow-category-moderators-to-create-subcategories/280203)._
