From 816686b70951e74f8418476dbbfb2ebf4b82f01d Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Tue, 24 Jan 2017 11:03:07 +0000 Subject: [PATCH] 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 --- src/wp-admin/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/users.php b/src/wp-admin/users.php index 5a5dc411c3..087d93f1b7 100644 --- a/src/wp-admin/users.php +++ b/src/wp-admin/users.php @@ -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; }