mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@16992 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -27,16 +27,15 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
) );
|
||||
}
|
||||
|
||||
function check_permissions() {
|
||||
function ajax_user_can() {
|
||||
if ( is_multisite() ) {
|
||||
$menu_perms = get_site_option( 'menu_items', array() );
|
||||
|
||||
if ( empty( $menu_perms['plugins'] ) && ! is_super_admin() )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !current_user_can('activate_plugins') )
|
||||
wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
|
||||
return current_user_can('activate_plugins');
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
|
||||
Reference in New Issue
Block a user