# Non-staff users can apply staff-only tags

**URL:** <https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151>\
**Category:** Product Support\
**Created:** [November 3, 2020, 6:51pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151 "2020-11-03T18:51:00Z")\
**Posts on this page:** 13\
**Page:** 1

## AI-generated summary

[bartv](/t/-/169151/1) reported that non-staff users on their Discourse site could apply staff-only tags like 'featured', which should be restricted. After testing in safe mode and confirming the issue across categories, [bartv](/t/-/169151/5) and [jamie.wilson](/t/-/169151/6) investigated tag group permissions. [jamie.wilson](/t/-/169151/8) clarified that staff tags should only be *addable* by staff, though visible to all — and couldn’t reproduce the issue locally. [bartv](/t/-/169151/9) confirmed the bug by showing a TL0 user successfully adding the 'featured' tag during topic creation. Further testing revealed the root cause: the tag '#featured' was accidentally included in both the staff-only group *and* the 'Common tags' group, which is available to everyone. [bartv](/t/-/169151/13) resolved the issue by removing the duplicate tag from the common group and apologized for the confusion. [jamie.wilson](/t/-/169151/14) reassured that the feature works as intended once configuration is correct, and encouraged feedback on its future use. The issue highlights that overlapping tag group permissions can override restrictions — if a user has access to a tag via *any* group, they can use it, regardless of other group restrictions.

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [November 3, 2020, 6:51pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/1 "2020-11-03T18:51:00Z")

</div>

I updated our site yesterday and just noticed a non-staff user applying our ‘featured’ tag to his post. This should not be possible as it’s defined as a staff-only tag. When I impersonated him, sure enough, I could access the restricted tags when posting. I tried to reproduce it here on meta, but I think tags are not available for regular users?

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

---

<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:** [November 3, 2020, 10:07pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/2 "2020-11-03T22:07:23Z")

</div>

I’ve tried to reproduce the issue on my local development site, but so far am not having any luck with it. Do you know if the issue is happening in all categories on your site, or is it just in a particular category that non-staff users are able to add staff tags? Any hints about how to reproduce the issue would be helpful.

---

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [November 4, 2020, 11:43am UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/4 "2020-11-04T11:43:52Z")

</div>

Ok, I’ll give in deeper to see what’s going on here and will get back to you. It may take a little time though.

---

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [November 4, 2020, 1:22pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/5 "2020-11-04T13:22:42Z")

</div>

Ok I tested with a TL-0 and TL-1 user in [safe mode](https://meta.discourse.org/t/53504?silent=true) and I can access the staff tag for every category on our forum. The same is true for the other tags on our staff-only list. I also reset the staff-only tag group permissions to ‘tags can be used by everyone’ and then back to ‘only the following groups can use them’, but that did not make a difference. Is there anything else I could test?

---

<div class="post-metadata">

**Author:** ![jamie.wilson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamie.wilson/32/185466_2.png) [@jamie.wilson](https://meta.discourse.org/u/jamie.wilson)\
**Post date:** [November 4, 2020, 4:25pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/6 "2020-11-04T16:25:00Z")

</div>

Do you have any other tag groups defined, or is the screenshot above the only group on your site? Are the users that you tested this with members of any other groups?

It is possible to create multiple tag groups with contradictory rules. If a user has permission to use a tag in _any_ tag group, that will cancel out the rules from any other group saying they can’t use it.

---

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [November 4, 2020, 4:40pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/7 "2020-11-04T16:40:07Z")

</div>

These are all the groups that I use; the test I ran was with a basic user who is not a member of anything.

## Common tags: available for everyone

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

## Events: can only be used in the Events category:

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/1/a121f39b5d101a4b0e0f2389bf9b8b9f1c653147.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/7/370e3fb5672ec00a44306841a0e97d2e1960a58d.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/0/f0c74efee1981787a5b17ac5aa53790ef43f9fe5.png)

---

<div class="post-metadata">

**Author:** ![jamie.wilson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamie.wilson/32/185466_2.png) [@jamie.wilson](https://meta.discourse.org/u/jamie.wilson)\
**Post date:** [November 4, 2020, 6:07pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/8 "2020-11-04T18:07:11Z")

</div>

> [@bartv](#):
>
> Ok I tested with a TL-0 and TL-1 user in [safe mode](https://meta.discourse.org/t/53504?silent=true) and I can access the staff tag for every category on our forum.

When you say ‘access’, do you mean you can add them to topics, or that you can view them and click on them, etc?

The tags in your ‘Staff Tags’ tag group (ba-tips, cant-reproduce, featured, etc) can only be added to topics by users belonging to the `staff` group, but are visible to everyone. This means anyone can see those tags at the top of topics, click on the tag to see other topics tagged with that tag, etc.

If a TL0 user is able to add a ‘Staff Tags’ tag (eg, ‘ba-tips’) to a topic, that is an issue. I have recreated the tags/tag groups as per your screenshots on my local Disocurse instance (limiting the tags in each tag group to the first three in each of the screenshots above), and my TL0/TL1 users are unable to add ‘ba-tips’ to a topic via the ‘New Topic’ button, or by creating a topic and then editing it. Are you able to add the tags via a different method/UI path?

---

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [November 5, 2020, 5:36am UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/9 "2020-11-05T05:36:22Z")

</div>

Thanks for your reply Jamie, sorry that I wasn’t specific enough. I just upgraded to latest and ran the test again, with the same result. Steps to reproduce are:

1. Log in as a TL0 or TL1 user
2. Change to [safe mode](https://meta.discourse.org/t/53504?silent=true) and disable everything
3. Select any category
4. Create a new topic
5. Select the Featured tag, which is staff-only.
6. Click ‘create topic’
7. The post is created and the feature tag is added

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/3/13d6d9ed74b34845c496aa065e49394c889a4070.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/b/2b45441af7d04bf0c4ee6a3fd9765f89cea331cc.png)

---

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [November 5, 2020, 8:03am UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/10 "2020-11-05T08:03:40Z")

</div>

I just saw something else that might be related: I can no longer access tag.json routes, like this one:

> [Topics tagged featured](https://blenderartists.org/tags/featured.json)

Update: whoops never mind, it seems like /tags/ got renamed to /tag/ which broke some of our automations.

---

<div class="post-metadata">

**Author:** ![jamie.wilson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamie.wilson/32/185466_2.png) [@jamie.wilson](https://meta.discourse.org/u/jamie.wilson)\
**Post date:** [November 5, 2020, 8:14pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/12 "2020-11-05T20:14:07Z")

</div>

Unfortunately, I’m still struggling to create a test case for this issue. Here are the steps I’ve taken:

1. Created new site at commit: 6490fac881
2. Created admin user: jamie.wilson
3. Enabled SiteSetting: tagging enabled
4. Created the following tags:  
360-renders  
add-ons  
advertisement  
conference  
contest  
meetup  
no-ads  
promotion-offered  
ba-tips  
cant-reproduce  
featured
5. Created the tag groups, as per supplied screen shots (with no more than 3 tags per group for the purposes of debugging)
6. Create ‘Events’ category, with a value of ‘Events’ for ‘Restrict these tag groups to this category’
7. Admin user created topic in ‘Site Feedback’ category with ‘ba-tips’ tag from staff group.
8. Log out admin user
9. Create new user (activated via email link): normal.user
10. As normal.user, create new topic in Uncategorized or Site Feedback. Available tags: 360-renders, add-ons, advertisement

 ![Screen Shot 2020-11-05 at 2.21.25 PM](https://global.discourse-cdn.com/meta/original/3X/9/c/9c9c7bbdbd00f59e12508a1eeeac570151d4a645.png)

 ![Screen Shot 2020-11-05 at 2.21.54 PM](https://global.discourse-cdn.com/meta/original/3X/e/c/ec1abbbe2f9ea38e7c8b4a27b1d174a75c372d75.png)

1. Create new topic in Events. Available tags: conference, contest, meetup

(not shown)

1. Admin user can add restricted tags to normal.user post:

 ![Screen Shot 2020-11-05 at 2.23.44 PM](https://global.discourse-cdn.com/meta/original/3X/c/1/c1eb00ab8ba0883ec5c32b9fe5e5e99258e845da.png)

1. Admin user can see all three tags:

 ![Screen Shot 2020-11-05 at 2.24.57 PM](https://global.discourse-cdn.com/meta/original/3X/d/f/df151d8e4ea48aba081adc6d67553f9a1ce1f5e1.png)

1. normal.user can only see two tags:

 ![Screen Shot 2020-11-05 at 2.57.40 PM](https://global.discourse-cdn.com/meta/original/3X/c/1/c1e1f3ae0dfd55878e73478411229713501aea77.png)

```plaintext
DiscourseTagging.permitted_tag_names(Guardian.new(User.find_by_username('normal.user')))
["360-renders", "add-ons", "advertisement", "conference", "contest", "meetup"]

```

```plaintext
DiscourseTagging.hidden_tag_names(Guardian.new(User.find_by_username('normal.user')))
["no-ads", "promotion-offered"]

```

Perhaps someone else is able to reproduce the issue? I’m unable to at this point.

---

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [November 6, 2020, 7:55am UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/13 "2020-11-06T07:55:49Z")

</div>

I believe I found the issue: #featured was present in both the staff-only list and our ‘common tags’ list. I’m not sure how it ended up there, I’ll have to check our staff permissions and see if they created it somehow. Sorry for wasting your time, but I do appreciate your support a lot! 🙏

---

<div class="post-metadata">

**Author:** ![jamie.wilson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamie.wilson/32/185466_2.png) [@jamie.wilson](https://meta.discourse.org/u/jamie.wilson)\
**Post date:** [November 6, 2020, 4:29pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/14 "2020-11-06T16:29:21Z")

</div>

> [@bartv](#):
>
> Sorry for wasting your time, but I do appreciate your support a lot!

Not a problem! I’m glad the root cause was found and we can all feel a little more confident that the new feature is working as intended.

I hope it proves useful for you and your site now the config issues have been rectified. Let us know how it works out for you.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [December 6, 2020, 4:37pm UTC](https://meta.discourse.org/t/non-staff-users-can-apply-staff-only-tags/169151/15 "2020-12-06T16:37:43Z")

</div>

Closed on December 6, 2020, 4:37pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
