Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing the capabilities of admin


  • janhart
    Participant

    @janhart

    Hi Everybody.
    On my site I have to change the capabilities manual. The thing is that every member have to upload and edit his and the group picture, editing the name of the group. But shouldnt delete or leave the group.
    Normally I have 3 options to set this from the backend. Thats not “deep” enough for this policy.
    Which file does I have to edit with a true or false thing on the user roles?
    Or can I edit the capabilities with a plugin direct from the backend?

    The site is used as a event site, less as a forum for the whole world. No new members will be added and no new gropus. Every member and group is added.

    Thanks alot in advance.

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

  • shanebp
    Moderator

    @shanebp

    You mean group admins?

    I don’t think group admins can leave a group.

    To remove the ability to delete groups for everyone except site admins, try:

    function janhart_remove_group_admin_tab() {
    	if ( ! bp_is_group() || ! ( bp_is_current_action( 'admin' ) && bp_action_variable( 0 ) ) || is_super_admin() ) {	
    		return;
    	}
    
    	// Add the admin subnav slug you want to hide in the following array
    	$hide_tabs = array(
    		'delete-group' => 1,
    	);
    
    	$parent_nav_slug = bp_get_current_group_slug() . '_manage';
    
    	// Remove the nav items
    	foreach ( array_keys( $hide_tabs ) as $tab ) {
    		bp_core_remove_subnav_item( $parent_nav_slug, $tab );
    	}
    
    	// You may want to be sure the user can't access
    	if ( ! empty( $hide_tabs[ bp_action_variable( 0 ) ] ) ) {
    		bp_core_add_message( 'You are not allowed to delete this group.', 'error' );
    		bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) );
    	}
    }
    add_action( 'bp_actions', 'janhart_remove_group_admin_tab', 9 );

    The capabilities you want to adjust are not related to WP roles.


    janhart
    Participant

    @janhart

    That is what I’m talking about:

    Group roles

    BuddyPress group members have three roles available to them.
    Administrators: Administratorshave total control over the contents and settings of a group. That includes all the abilities of moderators, as well as the ability to:
    Change group-wide settings (Admin > Settings). For instance, administrators can turn group forums on or off, change group status from public to private, and toggle on or off various other group functionality provided by plugins
    Change the group avatar (Admin > Group Avatar)
    Manage group members (Admin > Manage Members). More specifically, only group administrators have the power to promote members to moderators, or to ban individual users from the group
    Delete the group (Admin > Delete)

    The individual who creates the group is automatically the group’s first administrator. As a result, each group must have at least one administrator, though the first admin can choose to appoint others.

    Contents

    Privacy Options →
    Group roles →

    Create New Page


    janhart
    Participant

    @janhart

    The thing is that every site member is a admin in buddypress and his group.
    Therefore it is possible to delete or leave a group and invite other users.
    Only every member have to edit/uplaod a picture, change the description etc.
    The site will not add more users or groups. Everything is fine with that.
    Only the depth of the rules are not ideal.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar