Make WordPress Core


Ignore:
Timestamp:
04/07/2017 12:52:24 PM (8 years ago)
Author:
flixos90
Message:

Multisite: Introduce a setup_network capability for setting up multisite.

setup_network is a new meta capability that brings more granular control over the permissions to setup a multisite environment. In a non-multisite environment it falls back to manage_options while in a multisite it falls back to manage_network_options. The introduction of this capability furthermore allows replacing an is_super_admin() check.

Props ashokkumar24 for the original patch.
Fixes #39206. See #37616.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network.php

    r39019 r40390  
    1616require_once( dirname( __FILE__ ) . '/admin.php' );
    1717
    18 if ( ! is_super_admin() ) {
     18if ( ! current_user_can( 'setup_network' ) ) {
    1919    wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
    2020}
Note: See TracChangeset for help on using the changeset viewer.