[buddypress-trac] [BuddyPress Trac] #5869: Users with 'bp_moderate' capability required to also have 'manage_options' capability (was: bp_moderate capability doesn't allow access to Groups and Activity admin menus)

buddypress-trac noreply at wordpress.org
Tue Sep 9 17:52:54 UTC 2014


#5869: Users with 'bp_moderate' capability required to also have 'manage_options'
capability
--------------------------+------------------
 Reporter:  ryanjhale     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.2
Component:  Core          |     Version:  1.6
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------
Changes (by r-a-y):

 * keywords:   => dev-feedback
 * version:   => 1.6
 * milestone:  Awaiting Review => 2.2


Comment:

 Thanks for reporting this, ryanjhale.

 I took a closer look at why the `'manage_options'` cap is required even
 though the `'bp_moderate'` cap is set for a user and it appears this is a
 holdover from an earlier implementation of `'map_meta_caps'`.

 It appears that BP forces users with the `'bp_moderate'` cap to also have
 the `'manage_options'` cap.  See:
 https://buddypress.trac.wordpress.org/browser/tags/2.0.2/bp-core/bp-core-
 caps.php#L199

 For your use-case, I would recommend removing BP's filter in the interim:

 {{{
 remove_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins',
 10, 4 );
 }}}

 This should allow you to do what you want.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5869#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list