BuddyDev

Search

[Resolved] Upload content only users or modeators

  • Participant
    Level: Initiated
    Posts: 9
    Carlo on #43255

    Hello again!
    Is it possible to prevent that users who are NOT administrators / moderators also add content?
    thanks a lot!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #43274

    Hello Carlo,

    Thank you for posting here. Have you tried the following plugin:

    https://github.com/mediapress/mpp-global-shared-gallery/archive/refs/heads/master.zip

    It allows the gallery to be shared so that any other site user can upload content to the shared gallery.

    Please let me know if helps or not.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 9
    Carlo on #43280

    Hello, I don’t know if it does this, I don’t want users to be able to add content to the galleries.
    thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #43300

    Hi Carlo,
    Is this question about MediaPress?

    Are you using it with BuddyPress? Is it used for profile or group?(I am assuming group).

    Do you want to restrict group gallery creation/upload by admins and moderators?

    Please let us know and we will assist.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Carlo on #43339

    hi!
    – Is this question about MediaPress?
    Yes

    – Are you using it with BuddyPress? Is it used for profile or group?(I am assuming group).
    I create a group, i want administrator only can create galleries and upload media, rest of users only can download

    Thanks a lot!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #43457

    Hello Carlo,

    Please try the following code in your active theme functions.php file or bp-custom.php file

    
    add_filter( 'mpp_user_can_create_gallery', function( $can_create, $component, $component_id ) {
    	if ( 'groups' != $component ) {
    		return $can_create;
    	}
    
    	if ( groups_is_user_admin( get_current_user_id(), $component_id ) ) {
    		return true;
    	}
    
    	return false;
    }, 10, 3 );
    
    add_filter( 'mpp_user_can_upload', function ( $can_upload, $component, $component_id ) {
    	if ( 'groups' != $component ) {
    		return $can_upload;
    	}
    
    	if ( groups_is_user_admin( get_current_user_id(), $component_id ) ) {
    		return true;
    	}
    
    	return false;
    }, 10, 3 );
    
    

    Please let me know if it helps or not.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 9
    Carlo on #43487

    wow! best support ever!
    i test in these days report the result
    thanks so much!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #43489

    Hello Carlo,

    Thank you for the acknowledgment. I am glad that I could help you.

    Regards
    Ravi

The topic ‘ [Resolved] Upload content only users or modeators’ is closed to new replies.

This topic is: resolved