Opened 6 years ago
Closed 4 months ago
#8071 closed feature request (maybelater)
bp_current_user_can not returning expected results for bp_moderate users
Reported by: | Venutius | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: |
Description
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)
#2
@
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.
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.