Multisite: Replace `is_super_admin()` with `manage_network_users` when trying to change the role of oneself.
Props abhishek kaushik. Fixes #39204. See #37616. git-svn-id: https://develop.svn.wordpress.org/trunk@39943 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b7b052df58
commit
816686b709
|
@ -122,7 +122,7 @@ case 'promote':
|
||||||
wp_die(__('Sorry, you are not allowed to edit this user.'));
|
wp_die(__('Sorry, you are not allowed to edit this user.'));
|
||||||
// The new role of the current user must also have the promote_users cap or be a multisite super admin
|
// The new role of the current user must also have the promote_users cap or be a multisite super admin
|
||||||
if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap('promote_users')
|
if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap('promote_users')
|
||||||
&& ! ( is_multisite() && is_super_admin() ) ) {
|
&& ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) {
|
||||||
$update = 'err_admin_role';
|
$update = 'err_admin_role';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue