Make WordPress Core


Ignore:
Timestamp:
12/16/2010 09:18:28 AM (14 years ago)
Author:
nacin
Message:

Replace check_permissions() with ajax_user_can(). New method returns true/false to current_user_can(), which we then handle in admin ajax. see #15326.

File:
1 edited

Legend:

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

    r16990 r16992  
    2828    }
    2929
    30     function check_permissions() {
     30    function ajax_user_can() {
    3131        if ( is_multisite() ) {
    3232            $menu_perms = get_site_option( 'menu_items', array() );
    3333
    3434            if ( empty( $menu_perms['plugins'] ) && ! is_super_admin() )
    35                 wp_die( __( 'Cheatin’ uh?' ) );
    36         }
    37 
    38         if ( !current_user_can('activate_plugins') )
    39             wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
     35                return false;
     36        }
     37
     38        return current_user_can('activate_plugins');
    4039    }
    4140
Note: See TracChangeset for help on using the changeset viewer.