[buddypress-trac] [BuddyPress Trac] #6730: Default 'bp_xprofile_change_field_visibility' cap check passes

buddypress-trac noreply at wordpress.org
Wed Nov 25 19:32:22 UTC 2015


#6730: Default 'bp_xprofile_change_field_visibility' cap check passes
----------------------------------+--------------------
 Reporter:  r-a-y                 |       Owner:
     Type:  defect (bug)          |      Status:  new
 Priority:  normal                |   Milestone:  2.4.1
Component:  Component - XProfile  |     Version:  2.4.0
 Severity:  normal                |  Resolution:
 Keywords:  has-patch commit      |
----------------------------------+--------------------

Comment (by r-a-y):

 In [changeset:"10377"]:
 {{{
 #!CommitTicketReference repository="" revision="10377"
 Caps: Fix issue with passing an empty array as an argument in
 `bp_current_user_can()`.

 Changes to `bp_current_user_can()` in #6501 broke older capability checks
 relying on an empty argument to be passed in order to use a fallback
 value.

 Most notably, `bp_current_user_can('bp_xprofile_change_field_visibility'
 )`
 checks now passed by default.  This resulted in the "Change" link to
 always be visible when editing a profile field even if an admin has
 enabled
 "Enforce field visibility" for that particular field.

 This commit fixes this issue by passing a `null` value if there are no
 extra arguments to pass in `bp_current_user_can()`.  Commit also includes
 a unit test.

 See #6730 (trunk).
 }}}

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


More information about the buddypress-trac mailing list