Make WordPress Core

Ticket #43877: 43877.diff

File 43877.diff, 1.0 KB (added by flixos90, 6 years ago)
  • src/wp-includes/class-wp-user.php

     
    736736                $args = array_merge( array( $cap, $this->ID ), $args );
    737737                $caps = call_user_func_array( 'map_meta_cap', $args );
    738738
    739                 // Multisite super admin has all caps by definition, Unless specifically denied.
     739                if ( in_array( 'do_not_allow', $caps, true ) ) {
     740                        return false;
     741                }
     742
     743                // Multisite super admin has all caps by definition.
    740744                if ( is_multisite() && is_super_admin( $this->ID ) ) {
    741                         if ( in_array( 'do_not_allow', $caps ) ) {
    742                                 return false;
    743                         }
    744745                        return true;
    745746                }
    746747
     
    760761                // Everyone is allowed to exist.
    761762                $capabilities['exist'] = true;
    762763
    763                 // Nobody is allowed to do things they are not allowed to do.
    764                 unset( $capabilities['do_not_allow'] );
    765 
    766764                // Must have ALL requested caps.
    767765                foreach ( (array) $caps as $cap ) {
    768766                        if ( empty( $capabilities[ $cap ] ) ) {