WordPress.org

Make WordPress Core

Changeset 16776


Ignore:
Timestamp:
12/07/10 21:06:19 (3 years ago)
Author:
westi
Message:

Restore some more cap checks for clarity. See #15326.

Location:
trunk/wp-admin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit.php

    r16685 r16776  
    99/** WordPress Administration Bootstrap */ 
    1010require_once( './admin.php' ); 
    11  
     11if ( !current_user_can( $post_type_object->cap->edit_posts ) ) 
     12    wp_die( __( 'Cheatin’ uh?' ) ); 
     13             
    1214$wp_list_table = get_list_table('WP_Posts_List_Table'); 
    1315$wp_list_table->check_permissions(); 
  • trunk/wp-admin/link-manager.php

    r16175 r16776  
    99/** Load WordPress Administration Bootstrap */ 
    1010require_once ('admin.php'); 
     11if ( ! current_user_can( 'manage_links' ) ) 
     12    wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) ); 
    1113 
    1214$wp_list_table = get_list_table('WP_Links_List_Table'); 
  • trunk/wp-admin/plugin-install.php

    r16747 r16776  
    1212/** WordPress Administration Bootstrap */ 
    1313require_once('./admin.php'); 
    14  
     14if ( ! current_user_can('install_plugins') ) 
     15    wp_die(__('You do not have sufficient permissions to install plugins on this site.')); 
     16             
    1517if ( is_multisite() && ! is_network_admin() ) { 
    1618    wp_redirect( network_admin_url( 'plugin-install.php' ) ); 
  • trunk/wp-admin/plugins.php

    r16757 r16776  
    1010require_once('./admin.php'); 
    1111 
     12if ( !current_user_can('activate_plugins') ) 
     13    wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) ); 
     14             
    1215$wp_list_table = get_list_table('WP_Plugins_List_Table'); 
    1316$wp_list_table->check_permissions(); 
  • trunk/wp-admin/theme-install.php

    r16747 r16776  
    1212/** WordPress Administration Bootstrap */ 
    1313require_once('./admin.php'); 
     14if ( ! current_user_can('install_themes') ) 
     15    wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); 
    1416 
    1517if ( is_multisite() && ! is_network_admin() ) { 
  • trunk/wp-admin/themes.php

    r16754 r16776  
    99/** WordPress Administration Bootstrap */ 
    1010require_once('./admin.php'); 
    11  
     11if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) 
     12    wp_die( __( 'Cheatin’ uh?' ) ); 
     13             
    1214$wp_list_table = get_list_table('WP_Themes_List_Table'); 
    1315$wp_list_table->check_permissions(); 
Note: See TracChangeset for help on using the changeset viewer.