Skip to:
Content
Pages
Categories
Search
Top
Bottom

Groups visibility by role


  • halloy
    Participant

    @halloy

    Hello, I’ve 3 custom user role. I created BP groups but for each role, all groups should not be visible by all users.
    For example : 3 roles : role1, role2, role3 – 6 groups : group1, group2, group3, group4, group5, group6
    Each user with role3 can create its private group, not visible for role1 and role2. He can see all others groups. So it’s group could be masked if he can see others groups.
    Users with role2 cannot see groups created by users with role3 and cannot see group3, group4.They can see only groups 1,2 and 5. They are automatically added at group1 thanks the module Member Type Pro
    Users with role 1 are automatically add in group3 and can see oly itzs group and group4.
    Is there a plugin or a function to add that in the admin WP ?
    Like the plugin Menu Nav Role wich allos to display menu items by role.

    Thanks for your reply. I hope my answer is understandable because I’m french 😉

Viewing 1 replies (of 1 total)

  • Venutius
    Moderator

    @venutius

    I think this is possible to to but would require quite a bit of additional coding on your part, no exisitng plugin would do this.

    So for example in the file buddypress/groups/groups-loop.php there is the call to bp_has_members(). It’s possible to add to this the include= argument where you can choose which groups will be found. so you could add a function to this file which checks the user role and inputs only the groups that they can see.

    However you’d need additional function to allow you to add your groups to a groups/role list and keep that updaded when new groups are added. Then you could also create a function that adds new groups to this list on creation based on the member role. I’d be tempted to do this using group types but there’s a few options on exactly how this would be implemented.

    So it’s not an easy fix and would require custom coding.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar