Set tags as private


(Gabriel Tonon) #1

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:


Hide staff tags from non-staff users II
(Jay Pfaffman) #2

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”.


(Daquantics) #3

@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?


(Sara) #4

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


(Neil Lalonde) #5

@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


(Kane York) #7

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.)


(Neil Lalonde) #8

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.


(Sam Saffron) #10

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)


(Neil Lalonde) #11

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:


(Jeff Atwood) #12

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


(Neil Lalonde) #13

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:


Using discourse as ticket system, so no balls are dropped :woman_juggling:
How to use staff tags properly?
Topic Stopwatch
How to use staff tags properly?
(Tobias Eigen) #14

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


(Fellowship Forums) #15

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.


Topic Stopwatch
(Tobias Eigen) #16

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


#17

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.


(Neil Lalonde) #18

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


(Sara) #19

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.


(Daquantics) #20

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!


Limit Tag Creation To Staff
(Neil Lalonde) #21

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.