use meta caps in [14032], see #12109
git-svn-id: https://develop.svn.wordpress.org/trunk@14033 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e53c2d4da4
commit
46fe5b484f
@ -79,7 +79,7 @@ function edit_user( $user_id = 0 ) {
|
||||
$potential_role = isset($wp_roles->role_objects[$new_role]) ? $wp_roles->role_objects[$new_role] : false;
|
||||
// Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
|
||||
// Multisite super admins can freely edit their blog roles -- they possess all caps.
|
||||
if ( ( is_multisite() && is_super_admin() ) || $user_id != $current_user->id || ($potential_role && $potential_role->has_cap( 'edit_users' ) ) )
|
||||
if ( ( is_multisite() && current_user_can( 'manage_sites' ) ) || $user_id != $current_user->id || ($potential_role && $potential_role->has_cap( 'edit_users' ) ) )
|
||||
$user->role = $new_role;
|
||||
|
||||
// If the new role isn't editable by the logged-in user die with error
|
||||
|
Loading…
Reference in New Issue
Block a user