Opened 11 years ago
Closed 11 years ago
#5115 closed enhancement (fixed)
Admin panels meta cap review for Group and Activity moderation
Reported by: | ericlewis | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 1.9 | Priority: | normal |
Severity: | normal | Version: | 1.7 |
Component: | Administration | Keywords: | has-patch |
Cc: |
Description
The Activity and Groups admin menus are created with similar logic, here's the Groups for example:
if ( ! bp_current_user_can( 'bp_moderate' ) ) return; // Add our screen $hook = add_menu_page( __( 'Groups', 'buddypress' ), __( 'Groups', 'buddypress' ), 'manage_options', 'bp-groups', 'bp_groups_admin', 'div' );
This reads strange to me - we check if the user can 'bp_moderate', and then give add_menu_page the capability 'manage_options'. We should probably use the same capability 'bp_moderate in the add_menu_page call, in case an administrator might want to give a user the ability to moderate Activity and Groups, but not need to give them 'manage_options'.
Attachments (1)
Change History (4)
#1
@
11 years ago
- Milestone changed from Awaiting Review to 1.9
Most of the 'bp_moderate' checks were previously is_super_admin() checks. We never got around to building out capabilities the way we did in bbPress last year, so this is a relic of that.
Thanks for the patch! Moving to 1.9.
replace manage_options with bp_moderate in add_menu_page calls