Make WordPress Core


Ignore:
Timestamp:
12/16/2010 08:43:22 AM (13 years ago)
Author:
nacin
Message:

Remove check_permissions() calls outside of AJAX context. Also only check for switch_themes in check_permissions() for the themes table. see #15326.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-users-list-table.php

    r16900 r16990  
    2626
    2727    function check_permissions() {
    28         if ( !current_user_can('list_users') )
    29             wp_die(__('Cheatin’ uh?'));
    30 
    31         if ( $this->is_site_users && !current_user_can('manage_sites') )
    32             wp_die(__('You do not have sufficient permissions to edit this site.'));
     28        if ( ! $this->is_site_users && ! current_user_can( 'list_users' ) )
     29            wp_die( __( 'Cheatin’ uh?' ) );
     30
     31        if ( $this->is_site_users && ! current_user_can( 'manage_sites' ) )
     32            wp_die(__( 'You do not have sufficient permissions to edit this site.' ) );
    3333    }
    3434
Note: See TracChangeset for help on using the changeset viewer.