Opened 14 years ago
Closed 14 years ago
#21123 closed enhancement (fixed)
Enforce multisite plugins menu preference in map_meta_cap()
| Reported by: | nacin | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Multisite | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.' ) );