Support » Plugin: BuddyDrive » Role base Selection options

  • Resolved Rishikant

    (@rishikant)


    Respected Sir,
    Thanks for this wonderful plugin. We are working on an educational site using WP+BP.What we are trying to use this buddydrive, as specific role would be able to use it. We need options who can use it, whether Admin, Group Moderator or members.
    Hoping for reply soon.
    Thanks and regards

    http://wordpress.org/plugins/buddydrive/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Mathieu Viet

    (@imath)

    Hi, thanks for “wonderful” 🙂

    You can do it without an option actually. To do so, simply create a empty template named ‘buddydrive-noaccess.php’ in your theme’s folder. In it you can add the markup of your choice to tell the user he must have an higher level to benefit from BuddyDrive.

    Now in the functions.php of your theme, simply add these lines to load the no access template if the user hasn’t got the needed capacity. ( i’ve tried with a bbPress role > moderator, and it’s working )

    function rishikant_restrict_by_capacity( $template = '' ) {
    	if( !current_user_can( 'moderate' ) )
    		$template = 'buddydrive-noaccess';
    
    	return $template;
    }
    
    add_filter( 'buddydrive_user_files', 'rishikant_restrict_by_capacity', 10, 1 );
    Thread Starter Rishikant

    (@rishikant)

    Thanks for help, we are working on this.

    Hi imath,

    thank you for your plugin, it works great! 🙂

    I’ve just tried your above function and subscribers still have access to the BuddyDrive documents (I created the buddydrive-noaccess.php template too).

    This posts has 11 months, I was wondering if maybe this solution is not working anymore?

    Thank you in advance 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Role base Selection options’ is closed to new replies.