Set tags as private

Hi there,

Is it possible to set tags so that only certain users (e.g. admins, staff) can see it? If not, what would be the best way to achieve it?

Thanks in advance! :rofl:

1 Like

Yes. See https://YOURSITE/admin/site_settings/category/all_results?filter=tags

You can control who can tag and what tags are connected to which categories. You might also search here for “tag groups”.

6 Likes

@gabrieltonon appears to be asking about visibility, but @pfaffman seems to be talking about the creation of tags, or tagging of threads.

I looked in the admin settings, and I see options that allow me to limit the ability tagging/creation of tags by Trust Level, but nothing that lets me limit visibility. I also don’t see a way to limit any of the tag options to admins, staff, or moderators.

@sam’s post here seems to indicate that visibility settings are coming, but not yet implemented. Can anyone clarify whether this is currently possible or not?

5 Likes

Yes, I’d love to know if this is in the making and when we could expect this!

@sam said it’s on the roadmap, but it isn’t on our list for 2.0.

We have staff-only tags that can only be added to topics by staff, but they’re visible to everyone. We could also have a “visible only to staff tags” setting.

This?

36%20AM

9 Likes

What if you changed it so those two settings had a list of tag groups, instead of just a list of tags? If you’re using it for ticketing like @tobiaseigen is, those lists could get large fast, and adding a new status- tag but forgetting to add it here would result in it getting shown to the public.

(I’m assuming that making a new tag group is less common than adding a new tag within a group.)

8 Likes

Yeah we could do it on tag groups instead, in which case it would be a checkbox on the tag group instead of a list in the site settings.

3 Likes

Agree this makes sense in tag groups great suggestion @riking, so we would have basically a combo box on the tag group:

Who can apply these tags?

[Anyone]
[Staff only]

Who can see these tags?

[Anyone]
[Staff only]

I guess longer term this opens up the feature to more fidelity, cause you could have a tag visible to TL4 which can only be applied by Staff and stuff like that (clearly not for v1)

8 Likes

So at the same time we might as well remove the staff tags site setting and copy the category permissions UI. At some point it will feel like we’re building categories again.

:troll:

7 Likes

Sort of, except it is about who can use the tag, not the visibility of the topics inside the tag. That is quite different.

5 Likes

I committed v1 of this today. Find the new setting in the tag group UI:

If you find any hidden tags being rendered where they shouldn’t please report it as a bug. :ant:

20 Likes

Awesome. I updated to latest and enabled this setting, and it works. Many thanks. :rocket:

4 Likes

I tried implementing this maybe 5 minutes ago (maybe it takes some time to implement) but it doesn’t seem to be working. Tags are still appearing in the header.

you may need to do a hard refresh in your web browser. ctrl-f5

1 Like

This is a great feature, thanks for working on it! I do have request as a theme developer. This may be tricky given how you go about hiding the tag, but in a future version, could you consider adding a way to make the visible-to-staff-only tags accessible through the api?

Currently the only way that I’m aware of to access the tags of a topic using the api is something like the following:

<script type="text/discourse-plugin" version="0.8.19">
    api.includePostAttributes('topic');
    api.addPostTransformCallback((t) => {
        if (t.post_number === 1) {
            alert(t.topic.tags);
        }
    });
</script>

The problem with this is that the tags you get from t.topic.tags seem to follow the same rules as visibility. So if you write some code that depends on the existence of a visible-to-staff-only tag, it won’t fire for a non-staff user.

Hopefully that makes sense! The problem I’m trying to solve is being able to alter something in a topic for all users based on the existence of a visible-to-staff-only tag. I can only speak for myself, but I think this would be very useful for other theme developers going forward as well.

5 Likes

Your screenshot clearly shows that you’re logged in as an admin. Log out and view the topic again.

5 Likes

I don’t seem to have this “Tags are visible only to staff”-function on our Discourse? Why would that be?

Am I lacking rights or something else? We have the latest version.

I see that I can limit a Tag Groups visibility to Staff, but the options for “min trust to create tag” only go up to TL4.

We are planning to use tags internally, for tracking support trends – issues will be tagged by staff based on the different types of issues, which will all be in a “Support Tags” group that can only be seen by staff. For the moment, we don’t plan to display any tags publicly.

So am I right that this is not possible right now? TL4 users can still create tags, which will then be displayed to everyone right?

We only have about 25 users at that trust level and I can message them and tell them not to touch, but it seems like I should be able to limit tag creation privileges to Staff as well.

Please let me know If I’m missing something guys. Thanks!

1 Like

If you’re using the stable branch of Discourse, you can update to 2.0.1 which has this new feature. If you’re not on stable, then you should have had it already…

Yes, that’s true. I agree that we should add an option to limit tag creation to staff only.

5 Likes

Thanks for rolling this one out.

Is there a (rough) roadmap for the next iterations? Specifically, we’d like to have tags visible just for specific groups/levels outside of the staff group.

2 Likes