Skip to:
Content
Pages
Categories
Search
Top
Bottom

Exclude users with specific role from accessing forum


  • tfruba
    Participant

    @tfruba

    Hello All!

    I’m building a new website for my kid’s school and it’s fitted with bbpress forum engine.

    There’ll be three forums in general:
    – for parents,
    – for teachers
    – for administration

    What I’m trying to achieve is to give an access to the forums based on roles. I’ve created a three roles:
    – parent
    – teacher
    – admin
    And, until the user is assigned with only one of those roles – everything works great.

    The problem is when I assign a “Moderator” role to one of the users – they get an access to all three forums, instead of only the one that comes with base role. So, what I’d like to do is to restrict, that user with roles “teacher” and “parent” can’t have an access to the administration forum, unsless he/she also has a “admin” role assigned.

    Is this doable?

    Thank you in advance and best regards
    Tom

Viewing 5 replies - 1 through 5 (of 5 total)

  • Robin W
    Moderator

    @robin-w

    sorry, how are you restricting the roles to particular forums?


    tfruba
    Participant

    @tfruba

    Robin, I’m using a “Memebers” plugin that allows me to create custom roles with custom permissions. Then – in the forum configuration – I choose which roles have an access to this forum.

    The problem is that if the user has roles “X” and “Moderator” – he/she shouldn’t be able to access forum “Y”, but I have no idea how to do it.

    I’m sure it’s pretty simple, but still – can’t find a solution.


    Robin W
    Moderator

    @robin-w

    if you are using bbpress 2.6.x there is a moderator setting in the forums part (right hand side in dashboard forum edit) where you list users who can moderate


    tfruba
    Participant

    @tfruba

    Robin, I know that, but unfortunately – it’s completely useless for me, as the moderators will be changing quite often. It would be a ideal solution if there’d be another field to define a moderator roles, not specific users.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Users with the Moderator will always be able to have access to all forums. That is the intended purpose of that role.

    You will need to use a third-party add-on (like Restrict Content Pro or Paid Memberships Pro) to restrict access granularly.

    Since bbPress 2.6.0, there are hooks and APIs that make it possible to build a very specific plugin to do exactly like what you describe here (using the Engagements API) but I’m afraid I will not have the ability to build that out until after the holidays. Happy to provide guidance to any other devs who are interested!

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