has capability "Membership Admin" checks

On one of our client sites we are utilizing multiple custom admin levels. We have an "internal sales admin" level that only can see items related to "Users and Membership" capabilities. So they aren't technically an "Administrator" but instead of a custom user "Role" within our system. I guess my question is. Within Membership is the code specifically looking for explicitly "Administrator" as the role as well as the has_capability of Membership Admin if so why?

Just seems to make it conflict w/ our internal plugin to grant more granular access to our clients internal users.

I have given our user access to every level including "Administrator" level 10 etc. But I do not see membership showing up for a test user I have made. So it leads me to believe that it's possibly locking to the "Administrator" role.

This may be a "Feature Request" but I should be able to assign Membership admin access to any user I want in the system outside of a Contributor. In the shortterm is there any way to override this?

  • aware

    I understand that you have to Assign a user to be a Membership Admin.
    I may not have described the issue properly above.

    This may be more technical than a simple "check" of a box.
    Again I understand having to assign "Membership Admin" access.

    This can only be done for users that are explicitly set as "Administrator" roles in the system.
    The problem is we have an internal plugin that allows different/more granular Administrator levels.

    Example. We have Admins that can ONLY admin users (not plugins, themes etc). So they aren't in the default set of Administrators. So they wont show up in the list because they a different role. Which wouldn't be a problem if the system only utilized the has_capabillity check for "Membership Admin" but it appears that the plugin checks for the Administrator Role as well as the Membership Admin capability.

    Even if you utilize other plugins that give additional roles and capabilities you would probalby have some conflicts. I guess it's a feature request and may be outside the norm. Just wondering the reasoning behind the double check. I assume it's a security thing. But if you want more granular control of Roles and what not (which we do) you are kinda of forced to give a user COMPLETE access to the admin in order to just administrate Users specifically.

  • Kimberly

    Ok, that makes much more sense :slight_smile:

    The program wasn't developed with that in mind, obviously. This is more of a feature request as it's a workflow that suits you and not something we would imagine the average Joe WP guy needing.

    I can move and mark as such and see if anyone has any use for this as well. I can definitely see it being useful to have a way around the Admin only connection to WP roles.

  • aware

    Thanks, yeah if you can put it as a feature request that's cool. Really when it boils down to it. I just need a checkbox that asks. 'Do you want to only allow "Administrators" to be Membership Admins?' if checked. Only rely on the has_capability check for "Membership Admin" instead of both the capability check and role check. I'm sure it would probably conflict with any plugins that check for or give admins the ability to adjust individual user capabilities.

  • locomo

    +1 on this

    to limit the list of users eligible for membership admin, maybe the membership plugin could allow you to pick "eligible roles" from which the list is created .. so we could check admin and editor.. but not contributor & subscriber etc .. this would shorten the list of users considerably in most cases

    (i also have the need to assign membershipadmin privileges to users who don't have the administrator role)

  • locomo

    hack workaround that unfortunately modifies membership code - i modified this file:

    *note - swap out editor with the role you want to give access to

    // find function handle_options_panel_updates()
    // add this code below "$admins = $wp_user_search->get_results();"
    $wp_user_search = new WP_User_Query( array( 'role' => 'editor' ) );
    $otherrole = $wp_user_search->get_results();
    if ($otherrole) $admins = array_merge($admins, $otherrole);
    // find function  "show_users_options()"
    // add this code below "$admins = $wp_user_search->get_results();"
    $wp_user_search = new WP_User_Query( array( 'role' => 'editor' ) );
    $otherrole = $wp_user_search->get_results();
    if ($otherrole) $admins = array_merge($admins, $otherrole);

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.