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.
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
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.