Ticket #5869: 5869.02.patch
File 5869.02.patch, 1.4 KB (added by , 11 years ago) |
---|
-
src/bp-core/bp-core-caps.php
264 264 if ( bp_is_user_inactive( $user_id ) ) 265 265 return $caps; 266 266 267 // Only users that can 'manage_options' on this site can 'bp_moderate' 268 return array( 'manage_options' ); 267 // check explicitly for the 'bp_moderate' cap 268 $user = new WP_User( $user_id ); 269 if ( ! empty( $user->allcaps['bp_moderate'] ) ) { 270 return $caps; 271 272 // 'bp_moderate' cap does not exist; do not allow 273 } else { 274 return array( 'do_not_allow' ); 275 } 269 276 } 270 277 add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 ); 271 278 -
src/bp-members/bp-members-adminbar.php
75 75 global $bp, $wp_admin_bar; 76 76 77 77 // Only show if viewing a user 78 if ( ! bp_is_user() )78 if ( ! bp_is_user() ) { 79 79 return false; 80 } 80 81 81 // Don't show this menu to non site admins or if you're viewing your own profile 82 if ( !current_user_can( 'edit_users' ) || bp_is_my_profile() ) 82 // Don't show this menu to users who cannot moderate or if you're viewing your 83 // own profile 84 if ( ! bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() ) { 83 85 return false; 86 } 84 87 85 88 // Unique ID for the 'My Account' menu 86 89 $bp->user_admin_menu_id = 'user-admin';