Structure and Functionality for Public and Private Forums

Let’s imagine I’m setting up a site for readers that will allow its members to create reading groups. I have my own login system (via Laravel’s Auth system), so I’ll need Discourse to recognize that (which I think is possible via SSO).

Members of the site will be able to create their own groups, which I’ll want to then use an API to create the group forum in Discourse.

I’ll want to have some public forums, as well as provide for the private forums of the member groups. The structure might look like this:

Books (public)
± Fiction (public)
± Non-fiction (public)
Support (public)
My Groups (private to the logged-in user)
± Grandma’s Book Club (private to the logged-in user)
± Weekend Warriors Book Club (private to the logged-in user)

Is this sort of structure and functionality possible with Discourse?

I can only speak to the structure part of your question. My API/SSO knowledge is close to non-existant.

The structure is possible, just not exactly what you shared.

This is 100% possible and works right out of the box. Simply make new categories (and subcategories) and you’ll have this functionality.

This is where it doesn’t quite work out perfectly. Categories are intended to be a global organizational structure, not user specific. As such, creating a “My Groups” category is not doable. What you would need to do is something closer to this:

Groups (private to any logged-in user with at least one Blook Club)
± Grandma’s Book Club (private to any logged-in user in the “Grandma’s” group)
± Weekend Warriors Book Club (private to any logged-in user in the “Weekend Warriors” group).

Keep in mind that a user who cannot see a parent category will not be able to see any child categories even if the child category permissions would allow it to be seen.

2 Likes

The Groups part would actually be acceptable. Thanks for the help, @jomaxro!

Now, is there a write API for all that? :smiley:

1 Like

I’m about 99% sure there is. Check out

Yes. You can have the software on your site use API calls to add/delete people to groups. That’s not too hard. If you want your site to be able to create those groups and then manage them, that’s possible too, but a bit more tricky.

1 Like

A few tips:

If I recall correctly, the category/subcategory permissions are completely independent. You have to set permissions for each separately.

For the public categories, consider using tags instead of subcategories. It makes it easier for users to figure out which category to use.

[quote=“codinghorror, post:2, topic:45223”]
Categories are like walls. Build 4 and you have a nice house; build 24 and you have a maze.[/quote]

One downside with tags–users can’t set a tag on mobile initially except by publishing topic/edit topic/set tag/save again. Moderators can do it as new posts are created. Just depends on how important tags are to your site.

Avoid mixing group and category terminology, so call your private area, e.g., “My Clubs” (not My Groups) and then set up sub-categories which use groups to grant access to the sub-categories. Groups are for people and categories are for topics.

2 Likes

This is correct - there is no inheritance of category permissions. However, if a user cannot see the parent category, they cannot see any sub-categories due to the way the UI works. Showing a sub-category when the user can’t see the parent would cause all sorts of issues. I’m trying to find where @codinghorror previously clarified this…


Edit: So I couldn’t find a post by a Discourse dev in my quick searching, but I just tested this on my site and can confirm what I said above.

Two categories: Testing, and Testing Sub. Testing Sub has Testing as it’s parent category.
Testing has the following security Admin: Create, Reply, See
Testing Sub has the following security Admin: Create, Reply, See; everyone: Create, Reply, See
With those settings, I can confirm that non-admin users are not able to see either of those two categories.

Keep in mind that the critical setting here is see. If the Testing category had everyone: See, then Testing Sub would also be visible, even though everyone cannot post in Testing.

3 Likes

I’m pretty sure, though, that everyone will see topics in the subcategory in top and recent topic lists. (A client told me so last week.)

I did not test that. The topic wasn’t in /latest, nor could I see subcategory in any filter, menu, or selector.