# 允许现有群组的用户自由加入此群组

**URL:** https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470
**Category:** Feature
**Tags:** groups
**Created:** [2021年十二月8日 11:09 UTC](https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470 "2021-12-08T11:09:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Tris20](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tris20/32/264639_2.png) [@Tris20](https://meta.discourse.org/u/Tris20)
#### Post date: [2021年十二月8日 11:09 UTC](https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470/1 "2021-12-08T11:09:53Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/5/3/53e593346fab8680519904fd06ca10dcbbddccd9.png)

\n\n\n我们可以添加一个选项来补充上面的内容吗？

```plaintext
If(你已在 A 组)
    你可以自由加入此组
Else
    你必须发送加入请求

```

* * *

用例是我们有外部承包商。我们希望授予他们访问 Discourse 的权限。目前，他们可以像我们的员工一样自由加入相同的群组。这会造成保密问题。

如果我们让加入群组基于成员请求，那么我将不断收到成员请求，而我无论如何都会自动接受它们。此外，我只会养成默认接受它们的习惯，并且无疑会意外接受承包商的请求，从而完全破坏了目的。

我们的员工应该能够加入他们感兴趣的群组，但承包商只有在获得许可的情况下才能加入。

这有多大可能？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2021年十二月8日 12:07 UTC](https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470/2 "2021-12-08T12:07:50Z")

</div>

组是用户集合，可用于控制对类别的访问。您能否让您的员工访问所有类别，而无需他们加入组？（将员工组添加到所有这些类别）。或者您还有其他关于组的操作吗？

我怀疑这很快就会被纳入核心功能，但插件可以实现这一点。

如果这些建议是您已经知道的，而您真正想要的是该功能，我对此表示歉意。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2021年十二月8日 12:27 UTC](https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470/3 "2021-12-08T12:27:45Z")

</div>

@Tris20 我有点迷茫，但这不就是一种普通的功能，可以根据某个组（例如承包商组）允许访问某些类别，或者你最初想实现的是什么？

如果承包商是该特定组的成员，为什么他们必须加入另一个组才能访问另一个组？

---

<div class="post-metadata">

### Author: ![Tris20](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tris20/32/264639_2.png) [@Tris20](https://meta.discourse.org/u/Tris20)
#### Post date: [2021年十二月8日 13:04 UTC](https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470/4 "2021-12-08T13:04:35Z")

</div>

> [@pfaffman](#):
>
> 能否让您的员工在不要求他们加入组的情况下访问所有类别？

主要问题是用户无法自行修改类别的顺序：

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/d/8d02a0db452b898423575b321dd999a39c6f243c.png)

这意味着人力资源、财务、法务将看到上面的类别，☝

因此，如果我们让所有员工访问所有类别，我们也会暴露机密性问题。通过为每个类别创建一个组，我们知道谁可以访问信息。

类别数量也将非常多。我们更容易采取一刀切的类别方法：每个类别一个成员组和一个版主组。只有成为类别组成员才能看到该类别。例如，只有加入 Docker 组才能看到 Docker。

所以基本上，如果他们想查看相应类别，他们只需加入/离开该组。因此，一刀切的“员工”组实际上无法实现此目标（尽管我们无论如何都有一个用于一般用途的组）。

---

<div class="post-metadata">

### Author: ![Tris20](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tris20/32/264639_2.png) [@Tris20](https://meta.discourse.org/u/Tris20)
#### Post date: [2021年十二月9日 15:14 UTC](https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470/5 "2021-12-09T15:14:54Z")

</div>

> [@Jagster](#):
>
> 这不就是一个正常的功能，你可以根据某个群组（例如承包商群组）来允许访问某些类别，或者你一开始想实现的是什么？

如果我有三个承包商，每个类别一个：

1. Docker
2. Grafana
3. Linux

他们不能被允许查看他们没有签约的类别。

这是否意味着我需要创建“Docker-承包商”、“Grafana-承包商”等群组？不能为所有类别都这样做。

管理此问题的最有效方法是拥有一个利用基于电子邮件地址的自动分配（例如 `@external.com`）的承包商群组。然后，我可以专门限制这些用户的访问权限。

但是，_承包商群组的每个成员都将签约不同的工具，并且需要访问不同的区域_。因此，我要么允许承包商群组访问所有类别（这会使目的失效），要么为每个类别创建一个承包商群组（不行，不行，不行），或者……我们允许现有群组（所有员工）的成员自由加入该群组。

总的来说，拥有承包商意味着我根本无法使用“自由加入”功能。

---

<div class="post-metadata">

### Author: ![Tris20](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tris20/32/264639_2.png) [@Tris20](https://meta.discourse.org/u/Tris20)
#### Post date: [2021年十二月15日 12:44 UTC](https://meta.discourse.org/t/allow-users-of-an-existing-group-to-join-this-group-freely/211470/6 "2021-12-15T12:44:16Z")

</div>

此建议将解决两个相似的功能请求。

上述提议将允许所有成员自由加入群组（及相关类别），前提是他们属于“行为良好的用户”群组（ **或者甚至高于某个信任级别！** ）。低于信任级别或不属于“行为良好的用户”群组的用户必须通过请求加入。

> [@Need ability to ban one or more users from a category](https://meta.discourse.org/t/need-ability-to-ban-one-or-more-users-from-a-category/78604/16):
>
> Thanks for this suggestion! Can you give some hint on how to implement it? As far as I know group memberships are not indicated with HTML attributes. Is there some other way for CSS to detect whether or not someone is a member of a particular group?

同样，如果主题位于特定类别中

> [@Ban members from specific topics?](https://meta.discourse.org/t/ban-members-from-specific-topics/61800/2):
>
> We have no plans for this feature and it is not on any of our roadmaps at the current time.
