Skip to:

Opened 5 years ago

Closed 4 days ago

#8071 closed feature request (maybelater)

bp_current_user_can not returning expected results for bp_moderate users

Reported by: venutius's profile Venutius Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords:


If I assign a user bp_moderate capability, and give then list_users also. The user list does not display the extended profile link as I would expect.

The code that prints this link is in `buddypress/bp-members/classes/class-bp-members-admin.php line 1277:

if ( current_user_can( 'edit_user', $user->ID ) || bp_current_user_can( 'bp_moderate' ) ) { (edit_user typo reported in ticket #8069)

so giving bp_moderate capability to a user should allow that link to be displayed, however it does not.

Tracing this back I can see that wp's user_can will return true for bp_moderate for the administrator, but not for contributor, even though that capability has been added to the role. Is there something else I need to do in order to enable other roles to have bp_moderate?

Change History (3)

#1 @Venutius
5 years ago

  • Type changed from defect (bug) to feature request

I can see that this was a deliberate "temporary" fix back in the day and that _bp_enforce_bp_moderate_cap_for_admins() is intended to ensure only site admin get bp_moderate. That being the case, why have it at all? Why not replace all checks for bp_moderate with edit_options?

Personally I can think of many use cases where I'd want to assign a non-admin to be able to edit the BP side of things so I'd like to see this changed.

#2 @imath
3 years ago

  • Milestone changed from Awaiting Review to Awaiting Contributions

Hi @Venutius

Thanks for your feedback. I agree it should be possible to create a custom role like a community manager to deal with most of the BuddyPress features.

If someone wants to suggest a patch, I'd be very happy to review it. In the meantime, I'll put this ticket into the Awaiting contributions milestone.

#3 @espellcaste
4 days ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.