Ticket #12109: 12109.diff
File 12109.diff, 1.1 KB (added by , 15 years ago) |
---|
-
wp-includes/capabilities.php
722 722 $cap = $this->translate_level_to_cap( $cap ); 723 723 } 724 724 725 // Multisite super admin has all caps by definition.726 if ( is_multisite() && is_super_admin() )727 return true;728 729 725 $args = array_slice( func_get_args(), 1 ); 730 726 $args = array_merge( array( $cap, $this->ID ), $args ); 731 727 $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 732 736 // Must have ALL requested caps 733 737 $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args ); 734 738 foreach ( (array) $caps as $cap ) { … … 1027 1031 function current_user_can( $capability ) { 1028 1032 $current_user = wp_get_current_user(); 1029 1033 1030 if ( is_multisite() && is_super_admin() )1031 return true;1032 1033 1034 if ( empty( $current_user ) ) 1034 1035 return false; 1035 1036