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:
Felix Arntz 2017-01-24 11:03:07 +00:00
parent b7b052df58
commit 816686b709
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ case 'promote':
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
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';
continue;
}