• Resolved hiStrat76

    (@histrat76)


    Hi,

    I’m wondering if there is away that I can add a role capability to a user other than an admin that would allow them to view and download a group’s buddydrive documents without having to join the group. If I give them the manage_options capability, the user can, but I don’t want to give them that much control. Just be able to view any groups buddydrive. Is this possible?

    Thanks,
    Anne

    https://wordpress.org/plugins/buddydrive/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Anne,

    I think it’s a question of capability mapping and the particular capability to map should be a BuddyPress one : bp_moderate

    I think this is not specific to BuddyDrive but more to BuddyPress.

    Basically the mapping function could be something like :

    function histrat76_map_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
    
    	if ( 'bp_moderate' != $cap ) {
    		return $caps;
    	}
    
    	// Allow Editors to "BuddyPress moderate"
    	return array( 'manage_categories' );
    }
    add_filter( 'map_meta_cap', 'histrat76_map_meta_caps', 10, 4 );

    See this codex page for the capabilities list by role :
    http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table

    Thread Starter hiStrat76

    (@histrat76)

    By the way, thanks for this. It worked!

    Anne

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

The topic ‘Adding a role capability to view group buddydrive’ is closed to new replies.