Is there a way to make part of a post visible to a user group only?

AI-generated summary

The discussion revolves around making part of a post visible to a specific user group only. kenjdarhan wants to achieve this by having a post with contents visible to groups A and B, but with a paragraph only visible to group A.

simon suggests two possible approaches: using CSS to hide content for users not in group A, or publishing the full topic in a subcategory only accessible to group A users. However, simon feels the CSS approach is not secure enough.

merefield shares links to previous discussions on similar topics, including hiding part of a post and showing part of a post only for a specific group.

pfaffman proposes a plugin solution, using a category custom field and callbacks to create an excerpt topic in another category.

Marty_Downs asks if whispers work for groups other than staff or moderators, and JammyDodger responds that whispers are now allowed for other groups, which can be added to the whispers allowed groups admin setting.

For example, in my category X (visible to groups A and B), I want to post a topic with contents:

**paragraph visible to group A and B (all users who can see category X)**
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

**paragraph visible to only group A**
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The second paragragh should only be visible to group A.

Is there a way I can do that?

Thanks for any help.

I’m interested in doing something similar as a way of enticing users to pay to subscribe to a category. A couple of possible approaches:

  • use CSS to hide some of the topic’s content for users who are not in group A

  • publish the first paragraph (or whatever seems appropriate as an excerpt) to a topic in a category that’s accessible to both group A and B and publish the full topic to a subcategory that’s only accessible to group A users.

For my case, I don’t think the CSS approach would be secure enough.

Any details you can share about why you are wanting to do this would be helpful.

It would be great to hear other ideas about how to accomplish something like this.

This seems like a workable solution for a plugin. A category custom field would indicate a category for the excerpt. A on_create callback would create the excerpt topic in the other category. A more sophisticated version would use a topic custom field and a before_save to track the excerpt topic and could update it when the source was edited.

If you’d like for me to develop such a plugin please contact me.

Does whisper work for groups other than staff or moderators? I tried and couldn’t get it to. (I’m on a Discourse-hosted site)

Whispers are now group-allowed. :+1: You can add other groups to the whispers allowed groups admin setting: