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-ms-themes-list-table.php

    r16990 r16992  
    3737    }
    3838
    39     function check_permissions() {
     39    function ajax_user_can() {
    4040        $menu_perms = get_site_option( 'menu_items', array() );
    4141
    4242        if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
    43             wp_die( __( 'Cheatin’ uh?' ) );
     43            return false;
    4444
    4545        if ( $this->is_site_themes && !current_user_can('manage_sites') )
    46             wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
     46            return false;
    4747        elseif ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
    48             wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
     48            return false;
     49        return true;
    4950    }
    5051
Note: See TracChangeset for help on using the changeset viewer.