CSS classes for current groups who can view topic?

Continuing the discussion from CSS classes for current user's groups:

As the forums I build have more and more complex privacy settings, I really like the idea of making it more visible to people who can see what is being posted.

I like this concept, Display Posts Visibility, and wish I could take it further to show exactly which groups can see which topics.

Right now, Display Posts Visibility uses .archetype-regular and .archetype-private_message to show fully public vs fully private messages, but uses .read-restricted to show the ones that are restricted by groups. But since .read-restricted is not precise, it seems hard to figure out which groups can view the current topic.

If the CSS classes were there for which groups can see it, then it’d be a lot easier to style the page to make it more obvious to people.

Maybe it’s a simple theme component, like CSS classes for current user's groups, but I can’t seem to find something in the discourse/plugin-api.js at 99a6f32554e43a15da491c0e4db28a3537e98358 · discourse/discourse · GitHub to get the current groups that are able to view the topic.

Any ideas?

3 Likes

Groups that can see a topic are considered private information, so leaking that a group has access to a certain category is considered a bug in Discourse.

This means that you will need a plugin in order to expose this information to the UI.

3 Likes

I can see how that would be, as it could expose a lot of the hidden groups that exist on the platform and maybe for other reasons as well.

I can also see how the opposite—not letting people know which groups have access to a certain category—could be considered a violation of privacy. For example, if I post to the feature category, if I know it’s “restricted,” that could mean only other people in a Feature group could see it or it could mean everyone on the platform could still see it but maybe one group just doesn’t have the ability to create topics or replies. For a mostly public forum like Meta, maybe not a huge deal, as we probably assume most of the things we post are public, but as I think about hosting more private conversations, I become more sensitive to “wait, exactly who is going to be able to see what I type?”

Regardless, thank you for letting me know that it’s not currently possible but could be with a plugin :pray:

3 Likes