Skip to:
Content

BuddyPress.org

Changeset 7312


Ignore:
Timestamp:
07/26/2013 01:26:28 PM (11 years ago)
Author:
boonebgorges
Message:

Use bp_moderate cap for Activity and Groups panels

When adding the Activity and Groups administration panels using
add_menu_page(), use the 'bp_moderate' cap rather than 'manage_options'
(which was itself a stand-in for our old is_super_admin() checks).
This allows access to the panels to be granted to non-super-admin users
via plugin. The change also means that we can remove the redundant
current_user_can() check at the beginning of the methods in question.

Fixes #5115

Props ericlewis

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-admin.php

    r7240 r7312  
    2727 */
    2828function bp_activity_add_admin_menu() {
    29 
    30     if ( ! bp_current_user_can( 'bp_moderate' ) )
    31         return;
    3229
    3330    // Add our screen
     
    3532        __( 'Activity', 'buddypress' ),
    3633        __( 'Activity', 'buddypress' ),
    37         'manage_options',
     34        'bp_moderate',
    3835        'bp-activity',
    3936        'bp_activity_admin',
  • trunk/bp-groups/bp-groups-admin.php

    r7242 r7312  
    2727 */
    2828function bp_groups_add_admin_menu() {
    29 
    30     if ( ! bp_current_user_can( 'bp_moderate' ) )
    31         return;
    3229
    3330    // Add our screen
     
    3532        __( 'Groups', 'buddypress' ),
    3633        __( 'Groups', 'buddypress' ),
    37         'manage_options',
     34        'bp_moderate',
    3835        'bp-groups',
    3936        'bp_groups_admin',
Note: See TracChangeset for help on using the changeset viewer.