Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

#7280 closed enhancement (fixed)

Need a filter for bp_core_can_edit_settings()

Reported by: modemlooper's profile modemlooper Owned by: slaffik's profile slaFFik
Milestone: 2.8 Priority: low
Severity: minor Version:
Component: Navigation Keywords: good-first-bug has-patch commit
Cc:

Description

Or a better way to filter bp_moderate.

There is no way to allow a user that is not a site admin to access a users profile to edit content passed through bp_moderate check.

Example, have a site that has member type teacher who would want to edit a users profile avatar but the tab is blocked. You can ->nav-edit_nav and change user_has_access which displays the tab but when you click tab you get redirected.

The only way to actually view the tab is to filter bp_current_user_can and that opens the user to anything available to that cap. Not ideal when you want to be specific on what they can access.

a filter on $access = bp_core_can_edit_settings()

or right before core nav items are built

Attachments (1)

7280.patch (1.0 KB) - added by slaFFik 8 years ago.

Download all attachments as: .zip

Change History (8)

#1 @DJPaul
8 years ago

  • Keywords good-first-bug needs-patch added; dev-feedback 2nd-opinion removed
  • Milestone changed from Awaiting Review to Future Release
  • Severity changed from trivial to minor

Adding a filter is pretty trivial, so let's start by doing that.

#2 @modemlooper
8 years ago

  • Owner changed from imath to modemlooper
  • Status changed from new to assigned

#3 @slaFFik
8 years ago

  • Milestone Future Release deleted
  • Version 2.6.3 deleted

#4 @slaFFik
8 years ago

  • Milestone set to Future Release

#5 @slaFFik
8 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 2.8

@slaFFik
8 years ago

#6 @DJPaul
8 years ago

  • Keywords commit added
  • Owner changed from modemlooper to slaFFik
  • Status changed from assigned to reviewing

Patch looks good. Leaving this ticket for slaFFik to commit once his access comes through.

#7 @slaffik
8 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 11269:

Make bp_core_can_edit_settings() filterable.

New filter bp_core_can_edit_settings is introduced, with the context of a $status.

Props modemlooper.
Fixes #7280.

Note: See TracTickets for help on using tickets.