Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    At least for single-site, I believe filtering this should be enough:

    $minimum_cap = apply_filters( 'bp_registration_filter_minimum_caps', $capability );

    $capability in single site will be “manage_options”. You’ll be able to help me test if replacing that with something like “delete_users” would be enough.

    If so, then I’m likely going to change the default to “delete_users”. You will need a way to amend those roles to have that capability, for what it’s worth, unless you provide some other capability that those roles have already.

    Thread Starter freakency

    (@freakency)

    Hi Michael,

    thanks for getting back so quickly. I am fairly new to adding capabilities.

    I tried this:

    /*** allow keymaster to approve signups      .......*/
    $minimum_cap = apply_filters( 'bp_registration_filter_minimum_caps', $capability );
    $role_object = get_role( 'keymaster' );
    $role_object->add_cap( 'delete_users' );
    /***/

    but i must admit i am totally guessing at this 😉

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    This will get them the menus to show up:

    /**
     * Filters the minimum role required to see BPRO pages.
     */
    function freakency_bpro_custom_user_role( $capability ) {
    	return 'delete_users';
    }
    add_filter( 'bp_registration_filter_minimum_caps', 'freakency_bpro_custom_user_role' );

    The rest, meaning getting the role the capability, will be up to you, whether through your add_cap() above or some capabilities management plugin.

    Thread Starter freakency

    (@freakency)

    perfect. thanks for your help.

    Marcus

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Sounds good. Thanks for helping confirm working order, Marcus.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘registration approval by keymaster’ is closed to new replies.