[buddypress-trac] [BuddyPress Trac] #7048: Move permission checks in `bp_activity_screen_single_activity_permalink` into new function

buddypress-trac noreply at wordpress.org
Wed Jan 10 16:33:10 UTC 2018


#7048: Move permission checks in `bp_activity_screen_single_activity_permalink`
into new function
--------------------------------------+-----------------------
 Reporter:  DJPaul                    |       Owner:
     Type:  enhancement               |      Status:  assigned
 Priority:  high                      |   Milestone:  3.0
Component:  Activity                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |
--------------------------------------+-----------------------

Comment (by DJPaul):

 {{{
                 // Non-members have no access.
                 if ( ! groups_is_user_member( $user_id, $group_id ) ) {
                         $retval = false;
                 }

                 // Group admins and mods have access as well.
                 if ( groups_is_user_admin( $user_id, $group_id ) ||
 groups_is_user_mod( $user_id, $group_id ) ) {
                         $retval = true;
                 }
 }}}

 These are redundant. The `$group->user_has_access` takes care of
 `groups_is_user_member`, `groups_is_user_admin`, `groups_is_user_mod`.
 I've verified this.

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


More information about the buddypress-trac mailing list