Skip to:
Content
Pages
Categories
Search
Top
Bottom

New WP Role with access to Groups and Activity in dashboard.


  • skyrant
    Participant

    @skyrant

    I like to create a new group that has access to the Group and Activity Menu in the admin dashboard. Because BuddyPress does not use standard wordpress functionality when it comes to roles or capabilities i have not found any way to do this. It’s a right mess if you ask me and your documentation is lacking to say the least.

    Even giving a Role the bp_moderate capability does not work.

    Can you please provide a solution as to how i can give a new Role i created access to these 2 menu options in the dashboard/admin tool?

    Thanks in advance.

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

  • skyrant
    Participant

    @skyrant

    Just wanted to add that giving the new Role the manage_options capability is not an option.


    Ben Hansen
    Participant

    @ubernaut

    doesn’t currently exist in buddypress.


    skyrant
    Participant

    @skyrant

    That is not the answer i was looking for. If you have to design groups and capabilities in a non wordpress standard way then at least offer some way to control this mess. What a huge disappointment this is. Maybe the developers need to go back to the drawing board.


    Ben Hansen
    Participant

    @ubernaut

    well we are working on it this is an open source project if you have a desire to help make improvements you can make things happen faster πŸ™‚


    JJJ
    Keymaster

    @johnjamesjacoby

    Hey @skyrant, project lead chiming in here. Apologies for @ubernaut’s response; it doesn’t come across as very helpful or inviting, nor does it point you in any directions as to where to start building this type of functionality, which is the type of helpful reply I would expect from our forums normally.

    You’ll want to look into WordPress’s map_meta_cap filter, and more specifically, our bp_moderate capability checks.

    In the old days, we used a bunch of is_super_admin() checks to only allow the type of access you desire to network administrators. This proved to be too powerful an assumption once BuddyPress started working on Single-Site installations, and so we ported (almost) everything to checking for bp_moderate instead.

    You could create a new role and grant it the bp_moderate capability. In doing so, any user with that role will have the ability to moderate the entire BuddyPress community.

    This also is a bit more powerful than we would like it to be, and in the future we hope to introduce dedicated roles and capabilities all through-out BuddyPress very similarly to the way we did with bbPress. It’s not in the immediate roadmap however, so if this is an area you’re interested in, and want to help us improve it, let’s keep a dialogue going here and see if anyone else chimes in.


    JJJ
    Keymaster

    @johnjamesjacoby

    You can also look at our _bp_enforce_bp_moderate_cap_for_admins() function for a clue as to what might be preventing your bp_moderate role and capability checks from needing the additional manage_options capability.


    Ben Hansen
    Participant

    @ubernaut

    i’m sorry if you feel i’m not helping on this forum or just this thread i try to be strait to the point with my responses and try to shy away from anything relating to coding this thread perhaps was a bit of a borderline issue but please let me know if you feel like my participation is no longer desired around here.

    πŸ™‚


    JJJ
    Keymaster

    @johnjamesjacoby

    Hey @ubernaut. All thoughtful consideration is appreciated and encouraged, but your “doesn’t currently exist in buddypress” response was neither, considering @skyrant appeared to already frustrated by BuddyPress not performing to his expectations.

    It was also inaccurate, as functions like bp_current_user_can() exist explicitly to enable developers to extend this functionality. If skyrant is unable to make it work, more open-ended questions about the approach will help us figure out what’s not working correctly, be it on his/her end or ours.

    And this…

    please let me know if you feel like my participation is no longer desired around here

    This isn’t the case, and if it ever was to be, never let that stop you anyways. We are all trying to build cool things and improve the world through better open-source community software. It’s inclusive at it’s core. Only twice in eight years have we excluded anyone because of clearly malicious abuse of other members, and it still bothers me to have needed to do so.

    <3


    JJJ
    Keymaster

    @johnjamesjacoby

    Also @skyrant, it’s possible this is just a bug in our implementation, and using WordPress’s add_menu_page() function, which requires a capability be passed into it that is consequently checked on the current site being accessed, and not the root site where the bp_moderate capability is likely to be assigned.

    I’ve opened a ticket in our bug tracker to bring a bit more attention to this as a bigger issue, so if you end up creating any patches, go ahead and drop them there:

    https://buddypress.trac.wordpress.org/ticket/6175


    Ben Hansen
    Participant

    @ubernaut

    ok well thanks for clarifying i do try to defer as much as possible to people who know more than me around here (as well as in general). i probably jumped into this thread a bit too early anyway i know that wouldn’t be personally motived or anything i just want make sure I’m not giving bad advice/input on these threads.

    πŸ™‚


    skyrant
    Participant

    @skyrant

    John, Thank you for the pointers.

    I gave the Role bp_moderate but that did not solve the issue. There must be some other check that needs to be passed for these menu items to show up.

    Maybe a compromise could be found and some new functionality for the front end could be introduced that allows you to assign someone as Group Admin. I think i am not the only one that sees value in that Role especially in a big community where you have the need to moderate but do not want to give people access to the backend or higher Administrative privileges.

    I also don’t quite understand why a Group admin could not be derived from one of the Forum Roles. A forum Moderator or Keymaster should be able to moderate all Forums incl. the private group ones and could subsequently also be allowed to manage all groups.

    Just my 2 cents. let me know what you think.


    Ben Hansen
    Participant

    @ubernaut

    @jjj just thought i’d ping you since nobody followed up on this one and he was still asking questions.

    πŸ™‚


    Ben Hansen
    Participant

    @ubernaut

    oh i guess you changed your name bumping, @johnjamesjacoby

    πŸ™‚


    JJJ
    Keymaster

    @johnjamesjacoby

    I gave the Role bp_moderate but that did not solve the issue. There must be some other check that needs to be passed for these menu items to show up.

    You may want to put a late filter on map_meta_cap to ensure it’s truly getting added, and not getting stomped or mapped back to manage_options.

    Maybe a compromise could be found and some new functionality for the front end could be introduced that allows you to assign someone as Group Admin. I think i am not the only one that sees value in that Role especially in a big community where you have the need to moderate but do not want to give people access to the backend or higher Administrative privileges.

    You’re on the right track. Each component could (and maybe should) come with its own hierarchy of roles. Just because someone can manage users doesn’t mean they can manage groups, if that makes sense?

    I also don’t quite understand why a Group admin could not be derived from one of the Forum Roles. A forum Moderator or Keymaster should be able to moderate all Forums incl. the private group ones and could subsequently also be allowed to manage all groups.

    Anything is possible, but I’m not sure this approach is a safe assumption for all installations. At least not in its current iteration.

    All good ideas. Thanks @ubernaut for the bump.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘New WP Role with access to Groups and Activity in dashboard.’ is closed to new replies.
Skip to toolbar