# Add groups to category

**URL:** https://meta.discourse.org/t/add-groups-to-category/101774
**Category:** Support
**Created:** [11월 11, 2018, 9:13오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774 "2018-11-11T09:13:41Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![PatrickH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickh/32/116296_2.png) [@PatrickH](https://meta.discourse.org/u/PatrickH)
#### Post date: [11월 11, 2018, 9:13오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/1 "2018-11-11T09:13:41Z")

</div>

We are planning to use the groups more often.  
Now we have categories 2 layers deep.  
Is it possible to add specified groups categories to the second layer ?

Example:

Maincatagory: Marketing  
subcategory: Search engine optimization  
add a (closed) group to the subcategory: Search engine optimization: **SEO Expert group**

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [11월 11, 2018, 10:00오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/3 "2018-11-11T10:00:00Z")

</div>

Sure, it’s possible through category permissions in the Security tab

**Marketing** \> parent category, “everyone” can `Create / Reply / See`  
**Search engine optimization** \> child category, “SEO expert group” can `Create / Reply / See` (this means that “everyone” can’t see the subcategory at all, unless you set “everyone” to `See` or to `Reply / See`

---

<div class="post-metadata">

### Author: ![PatrickH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickh/32/116296_2.png) [@PatrickH](https://meta.discourse.org/u/PatrickH)
#### Post date: [11월 11, 2018, 10:11오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/4 "2018-11-11T10:11:40Z")

</div>

Yes, i know that, but what if want everyone to see the **Search engine optimization** group and have a special group under **Search engine optimization**?  
And that group is the SEO expert group

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [11월 11, 2018, 10:29오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/5 "2018-11-11T10:29:41Z")

</div>

> [@PatrickH](#):
>
> if want everyone to see the **Search engine optimization** group

You mean **SEO expert group** I think.

It doesn’t matter, the category permissions are superior to everything, so even if a group is set to be seen by “everyone”, “everyone” can only see the public topics, not those of restricted categories.

---

<div class="post-metadata">

### Author: ![PatrickH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickh/32/116296_2.png) [@PatrickH](https://meta.discourse.org/u/PatrickH)
#### Post date: [11월 11, 2018, 10:38오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/6 "2018-11-11T10:38:00Z")

</div>

> [@dax](#):
>
> You mean **SEO expert group** I think.

No,  
**Marketing** \> parent category,  
**Search engine optimization** \> child category,  
**Search engine optimization Experts** \> child, child category,

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [11월 11, 2018, 10:47오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/7 "2018-11-11T10:47:22Z")

</div>

It is not possible to configure more than one level of sub-categories, our structure is `parent category > child category`.

---

<div class="post-metadata">

### Author: ![PatrickH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickh/32/116296_2.png) [@PatrickH](https://meta.discourse.org/u/PatrickH)
#### Post date: [11월 11, 2018, 10:49오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/8 "2018-11-11T10:49:51Z")

</div>

ok that’s to bad.  
Is it possible to solve this in an other way ?

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [11월 11, 2018, 11:29오전 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/9 "2018-11-11T11:29:32Z")

</div>

We use tags instead of sub-sub-categories, see

> **[It’s Time We Talked About Tags](https://blog.discourse.org/2017/10/its-time-we-talked-about-tags/)**
>
> Consider the typical sections of a daily newspaper: Arts, Sports, Business, Travel, Local, and World. Any given article belongs to just one of those sections, and the content in each section is quite different, such that some people, for example, may...

---

<div class="post-metadata">

### Author: ![thaidb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thaidb/32/68488_2.png) [@thaidb](https://meta.discourse.org/u/thaidb)
#### Post date: [12월 20, 2020, 2:53오후 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/10 "2020-12-20T14:53:37Z")

</div>

안녕하세요, discourse  
카테고리의 모든 하위 카테고리(slug-1 slug-2 slug-3 slug-4)에 “level-3” 그룹을 추가하고 싶은데,  
어떤 콘솔 명령을 사용해야 하나요?  
감사합니다! 🙂

---

<div class="post-metadata">

### Author: ![thaidb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thaidb/32/68488_2.png) [@thaidb](https://meta.discourse.org/u/thaidb)
#### Post date: [12월 21, 2020, 4:52오후 UTC](https://meta.discourse.org/t/add-groups-to-category/101774/11 "2020-12-21T16:52:15Z")

</div>

```plaintext
category_ids = [6,7,8,10]

```

> Category.where(id: category\_ids).find\_each do |category|  
> category.set\_permissions(:staff =\> :full)  
> category.save!  
> end
