[buddypress-trac] [BuddyPress Trac] #7610: Use bp_user_can for some group-related permissions.

buddypress-trac noreply at wordpress.org
Wed Nov 8 16:51:10 UTC 2017


#7610: Use bp_user_can for some group-related permissions.
-------------------------+------------------------------
 Reporter:  dcavins      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Groups       |     Version:  2.9.0
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by DJPaul):

 Hey @dcavins
 I haven't checked you've implemented the logic as per the original, but
 assuming that's good, the patch is pretty good. Some minor feedback:

 * in_array() third parameter should be true, for type strictness.
 * Use type strict logical operators, e.g. === instead of ==.
 * The `break` indentation in the switch statements is a little off in
 places, I think. Worth double-checking.
 * The test names should be human readable. Take test
 "user_can_groups_see_group_private_logged_in_user" -- I can see it's built
 off the capability name, but it should be readable if you see it in the
 terminal output. e.g. "user_can_join_private_groups" (or whatever).
 * The test names also currently read positive, if that makes sense. If a
 test uses `assertFalse`, then the test name should make it clear that it
 is testing something that should not happen. e.g.
 "anonymous_user_cannot_join_private_groups".

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


More information about the buddypress-trac mailing list