XF 2.1 Easiest way to make 1 forum visible and the rest hidden, on a per user basis.

Hello,

I have a Node Category called "Teams", which I currently set to "Private"

Within it, are 30 child Nodes Forums, each representing a different team, and all inheriting their visibility from the parent node.

Teams Category (set to private)
  • Team 1 (child forum)
  • Team 2
  • Team 3
  • ...
  • Team 30

If a user decides to join a team (say, team 3) then I would like to make the "Team 3" forum visible to that user, while keeping the rest of the child nodes private.

What would be the easiest way to do that? Do I need to create 30 different User_groups, one for each Team, and then assign that user to the corresponding secondary_user_group? Hopefully there is an easier way.

Thank you.

P.S. I think I may have it backwards. Would it be better to set the Teams Category to visible, and then assign all 30 child forums as private?

Thanks.
 
Okay, So I see 2 possible solutions.... I'm not sure which one is easier or "better" in terms of a clean approach....

Initial Node Setup

Teams Category (view for everyone)
  • Team 1 (child forum - set to private)
  • Team 2 (child forum - set to private)
  • Team 3 (child forum - set to private)
  • ...
  • Team 30 (child forum - set to private)
Approach 1

- Create 30 user_groups (one for each Team)
- Set view permission for each user_group

- Add users to the corresponding secondary_user_group as they join a team

Approach 2


- use the 'set permissions for user' feature within each team node,
- and then add each user to that node as they join a team

- set view permissions for each user as they are added


Summary

It seems like 6 of one, and half a dozen of the other. I can not really see that much of a difference between approaches.

Does anyone have a 3rd idea? Or any reason why one approach is better than the other?

Thanks.
 

Brogan

XenForo moderator
Staff member
For your situation is doesn't really make much difference as only a single node is accessible at a time.

I would probably go with setting the category to visible and the forums to private.
 

Brogan

XenForo moderator
Staff member
Not really.

If the category is private, you would need to add view permissions to the category for the member, then hide 26 of the forums.

Conversely, if the category is visible, you just need to add view permissions for 4 of the forums.
 
Thanks.

Now If I were to do this using the API, could I:

Approach 1
- Create a User_Group with the API
- Assign a User to that User_Group with the API

Approach 2
- Give a User special privileges to view a specific node through the API

I looked the API endpoints, and it did not look possible for either case. Did I miss something, or is it not possible via the API?
 

Brogan

XenForo moderator
Staff member
I'm not familiar with the API endpoints but if you didn't see the ones you need listed then they don't exist.

Don't forget to check the new beat endpoints.

 

gib

Active member
One of the Social Groups plugins might be able to do what you need, giving user control of what forums (groups) they can join / leave
 
One of the Social Groups plugins might be able to do what you need, giving user control of what forums (groups) they can join / leave
That's great thanks. I keep forgetting about checking the plugins/addons.

Your suggestion did lead me to discover something else, it's called Clone User Groups.


I know there has been a ton of discussion about how it is the wrong approach, like here:


And Brogan even wrote up an article here:


But I think for my needs, cloning groups is the way to go.

I mean, if I have 30 team forums, and I need to create 30 user_groups, one for each team forum, then wouldn't the Clone User Groups plugin make it easier to duplicate the groups? Then I can just add users to each user_group they need to be members of. I think that is a valid reason to clone user_groups, isn't it?
 
  • Like
Reactions: gib
Top