WordPress.org

Make WordPress Core

Changeset 13270


Ignore:
Timestamp:
02/21/2010 12:19:05 AM (8 years ago)
Author:
wpmuguru
Message:

use map_meta_cap for multisite superadmins, props dd32, fixes #12109

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r13034 r13270  
    723723        }
    724724
    725         // Multisite super admin has all caps by definition.
    726         if ( is_multisite() && is_super_admin() )
    727             return true;
    728 
    729725        $args = array_slice( func_get_args(), 1 );
    730726        $args = array_merge( array( $cap, $this->ID ), $args );
    731727        $caps = call_user_func_array( 'map_meta_cap', $args );
     728
     729        // Multisite super admin has all caps by definition, Unless specifically denied.
     730        if ( is_multisite() && is_super_admin() ) {
     731            if ( in_array('do_not_allow', $caps) )
     732                return false;
     733            return true;
     734        }
     735
    732736        // Must have ALL requested caps
    733737        $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args );
     
    10281032    $current_user = wp_get_current_user();
    10291033
    1030     if ( is_multisite() && is_super_admin() )
    1031         return true;
    1032 
    10331034    if ( empty( $current_user ) )
    10341035        return false;
Note: See TracChangeset for help on using the changeset viewer.