Multisite: Replace `is_super_admin()` with `manage_network_users` when trying to change the role of oneself.
Props abhishek kaushik. Fixes #39204. See #37616. Built from https://develop.svn.wordpress.org/trunk@39943 git-svn-id: http://core.svn.wordpress.org/trunk@39880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
64694c6742
commit
6fcb0e8b7f
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.8-alpha-39942';
|
||||
$wp_version = '4.8-alpha-39943';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue