# Ban members from certain categories?

**URL:** https://meta.discourse.org/t/ban-members-from-certain-categories/62916
**Category:** Feature
**Created:** [18.Май.2017 03:57:09 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916 "2017-05-18T03:57:09Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [18.Май.2017 03:57:09 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/1 "2017-05-18T03:57:09Z")

</div>

Most of our forum is pretty general. However, one part is a “forum game”. If you get caught cheating, you get banned from playing. However, we can’t actually ban them from that specific category … **or can we?** It’s getting hard to moderate.

**EDIT:** A workaround, I made a group to store the people suspended from a certain category. However, it would be great if I could natively ban people from certain categories (with the see/create/reply permission options).

![](https://global.discourse-cdn.com/meta/original/3X/7/5/75526d803e7568bf893670a6119ee176500522df.png)

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [18.Май.2017 04:39:28 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/2 "2017-05-18T04:39:28Z")

</div>

I think the only way to do this would be to create a group that includes everyone who is allowed to be in the category.

It would be nice to have a negative category permission available on category security settings, e.g. “Cannot create/reply/see”. But that does not exist now.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [18.Май.2017 04:40:40 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/3 "2017-05-18T04:40:40Z")

</div>

This is 100% covered by groups, just remove the cheaters from the **game** group and they can’t access the category anymore.

---

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [18.Май.2017 04:41:19 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/4 "2017-05-18T04:41:19Z")

</div>

> [@Falco](#):
>
> This is 100% covered by groups, just remove the cheaters from the game group and they can’t access the category anymore.

So default put everyone in a “game” group, then REMOVE them as they are suspended? Interesting

---

<div class="post-metadata">

### Author: ![Iceman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iceman/32/181309_2.png) [@Iceman](https://meta.discourse.org/u/Iceman)
#### Post date: [18.Ноябрь.2021 13:50:39 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/5 "2021-11-18T13:50:39Z")

</div>

Извините за некрономанию, но это лучший результат при поиске, а другие темы (ссылки ниже) либо закрыты, либо не так четко отвечают на вопрос.

Следуя логике, изложенной здесь и в схожих темах, кажется, что лучший способ — добавить группу «Все» в определенную группу, а затем исключить из этой группы пользователей, которых вы хотите «заблокировать» в категории, поскольку [у нас нет возможности убрать разрешение «просмотр» для групп, можно только добавить](https://meta.discourse.org/t/add-cant-see-logic-to-category-permissions/113456).

Это выглядит логично, но предположим, что в вашем инстансе 5000 пользователей: нужно ли добавлять их всех вручную? И обновлять список каждый раз, когда присоединяется новый пользователь? Я не уверен, есть ли какой-то «чит-код» вроде «@все» при добавлении пользователей в группу — похоже, что нет.

Есть ли лучший способ, который я упустил?

Спасибо.

Другие связанные темы:

> [@Can I make some Topics in a Category which only certain Groups can see and participate in?](https://meta.discourse.org/t/can-i-make-some-topics-in-a-category-which-only-certain-groups-can-see-and-participate-in/142906):
>
> Is this possible? I have searched for the answer to this and I have decided that this is ‘likely’ not possible right now but I want to be sure. Could it be done with a simple plugin (vs a complex plugin that only an expert could write)? I do not want to make a Category which only certain Groups can see and participate in. Also, a PM is not what I am looking for.

> [@New category permission - "cannot see"/"exclude"](https://meta.discourse.org/t/new-category-permission-cannot-see-exclude/50044):
>
> Continuing the discussion from [Suspend as way to expire membership](https://meta.discourse.org/t/suspend-as-way-to-expire-membership/49955/3): After suggesting to another user that instead of suspending a user they could put them in a group and change category permissions. I recently came across my own use case for this, where I needed to add some users to my instance and only give them access to one category. It does not seem like there is an easy way to do so, without modifying the permissions for every other category, and putting all other users in their own grou…

> [@Negative group permissions](https://meta.discourse.org/t/negative-group-permissions/79576):
>
> Does anyone have any ideas, tips or tricks how to exclude members from a specific group from accessing a specific category? What would be the easiest way to accomplish that?

> [@Understanding groups and category permissions](https://meta.discourse.org/t/how-to-create-private-categories-using-category-security-settings/87678):
>
> bookmark This guide explains how to manage category visibility and user permissions using groups in Discourse. person_raising_hand Required user level: Administrator Groups and category permissions are crucial for managing access and content creation within your Discourse community. This guide will help you understand how to use these features effectively. Summary Category permissions control visibility and user actions Permissions are managed through group access lists Different perm…

---

<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: [19.Ноябрь.2021 00:18:10 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/6 "2021-11-19T00:18:10Z")

</div>

Правильно… Нет хорошего способа заблокировать кого-то только в одной категории. Это случается нечасто. Обычно, если вы хотите кого-то заблокировать, то делаете это везде. Можно было бы через консоль Rails добавить всех в группу, а затем удалить нужного человека, но это было бы неудобно.

Можно создать плагин, который добавляет всех в группу, а затем имеет настройку сайта со списком пользователей, которых не следует включать в эту группу.

---

<div class="post-metadata">

### Author: ![kevincox](https://avatars.discourse-cdn.com/v4/letter/k/d6d6ee/32.png) [@kevincox](https://meta.discourse.org/u/kevincox)
#### Post date: [16.Январь.2026 14:44:22 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/7 "2026-01-16T14:44:22Z")

</div>

Я бы тоже с радостью увидел это. У нас тоже похожая ситуация.

1. У нас есть несколько категорий, доступных только определённым группам.
2. Но нам также нужно иметь возможность исключать из них отдельных пользователей.

Поддержка отрицательного членства в категориях решила бы задачу. Однако, на мой взгляд, более мощным и гибким решением было бы внедрение автоматически создаваемых групп, определяемых пользователем (как это уже реализовано для группы «staff»). Такие группы могли бы поддерживать базовые операции над множествами для определения членства.

Например, с этой функцией группа «staff» не была бы исключением, а просто определялась бы как `admin + moderators`. Тот факт, что такая автоматическая группа уже создана, является сильным указанием на то, что эта функция полезна и должна быть расширена до общей возможности, а не оставаться встроенным исключением.

С её помощью можно было бы реализовать отрицательное исключение, создав группу `HasAccess = AccessGroup - BannedGroup`.

Такие автоматические группы были бы очень полезны и для других сценариев. Например:

## Увеличивающиеся ранги

В настоящее время у нас есть несколько закрытых форумов, которые в основном охватывают более узкие круги людей. Что-то вроде:

- Admin = Admin
- Moderators = Admin + Moderators
- BetaTeam = Admin + Moderators + Beta
- Trusted = Admin + Moderators + Beta + Trusted

Необходимость вручную указывать правильный список групп для каждой категории утомительна и чревата ошибками. У нас было много случаев, когда одна из групп отсутствовала в категории, к которой у неё должен был быть доступ. Возможность определять группы таким образом значительно упростила бы управление:

- ModeratorsOrHigher = Admin + Moderators (это уже реализовано как встроенная автогруппа `staff`)
- BetaOrHigher = ModeratorsOrHigher + Beta
- TrustedOrHigher = BetaOrHigher + Trusted

## Общие группы

Также для нас типично наличие нескольких категорий с абсолютно одинаковыми правилами доступа. Это, по сути, более простой случай, чем описанный выше, но было бы удобно создать одну автогруппу и использовать её многократно, вместо того чтобы повторять весь список групп и синхронизировать его во многих категориях.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [16.Январь.2026 15:22:57 UTC](https://meta.discourse.org/t/ban-members-from-certain-categories/62916/8 "2026-01-16T15:22:57Z")

</div>

Вы уже посмотрели плагин динамических групп?

> [@Discourse Dynamic Groups](https://meta.discourse.org/t/discourse-dynamic-groups/365342):
>
> information_sourceSummary Automatically manage group membershiphammer_and_wrenchRepository Link [https://github.com/communiteq/discourse-dynamic-groups](https://github.com/communiteq/discourse-dynamic-groups)open_bookInstall Guide [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157)warning This plugin should be considered beta warningFeatures Discourse communities often need to automate group memberships based on conditions like badge ownership or existing group memberships. Common use cases include: Users not in the ‘subscribers’…
