Opened 13 years ago
Closed 13 years ago
#21123 closed enhancement (fixed)
Enforce multisite plugins menu preference in map_meta_cap()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.5 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Multisite | Keywords: | |
| Focuses: | Cc: |
Description
Rather than doing this:
if ( is_multisite() ) {
$menu_perms = get_site_option( 'menu_items', array() );
if ( empty( $menu_perms['plugins'] ) && ! current_user_can( 'manage_network_plugins' ) )
wp_die( __( 'Cheatin’ uh?' ) );
}
if ( !current_user_can('activate_plugins') )
wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
We should simply map activate_plugins to manage_network_plugins in map_meta_cap() when the conditionals are proper.
Change History (3)
Note: See
TracTickets for help on using
tickets.
Additionally, these checks make little sense in the network admin:
$menu_perms = get_site_option( 'menu_items', array() ); if ( empty( $menu_perms['themes'] ) && ! is_super_admin() ) wp_die( __( 'Cheatin’ uh?' ) ); if ( !current_user_can('manage_network_themes') ) wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );