use meta caps in [14032], see #12109

git-svn-id: http://svn.automattic.com/wordpress/trunk@14033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-04-07 21:04:42 +00:00
parent f609d0c8a3
commit b90e44bbb9
1 changed files with 1 additions and 1 deletions

View File

@ -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