Make WordPress Core

Changeset 13934


Ignore:
Timestamp:
04/02/2010 04:30:00 AM (14 years ago)
Author:
nacin
Message:

Allow MS cape-wearers to demote their blog roles to something without the edit_users cap. see #12387

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/user.php

    r13844 r13934  
    7979        $potential_role = isset($wp_roles->role_objects[$new_role]) ? $wp_roles->role_objects[$new_role] : false;
    8080        // Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
    81         if ( $user_id != $current_user->id || ($potential_role && $potential_role->has_cap( 'edit_users' ) ) )
     81        // Multisite super admins can freely edit their blog roles -- they possess all caps.
     82        if ( ( is_multisite() && is_site_admin() ) || $user_id != $current_user->id || ($potential_role && $potential_role->has_cap( 'edit_users' ) ) )
    8283            $user->role = $new_role;
    8384
Note: See TracChangeset for help on using the changeset viewer.