[buddypress-trac] [BuddyPress Trac] #4785: Decouple "visibility" and "access" properties

buddypress-trac noreply at wordpress.org
Thu Jul 3 21:30:52 UTC 2014


#4785: Decouple "visibility" and "access" properties
-------------------------+------------------
 Reporter:  smninja      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.1
Component:  Groups       |     Version:  1.7
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by dcavins):

 Hi Boone-

 I can't get the public tab in a private group case to work with a logged-
 in, non-group-member user (or logged-out user). At the end of
 `BP_Group_Extension::setup_access_settings`, my parameters look good:

 {{{
 [enable_nav_item] => 1
 [visibility] => public
 [user_can_see_nav_item] => 1
 [user_can_visit] => 1
 }}}

 but when I attempt to navigate to the plugin's display screen, I'm bounced
 back to the group's front page. In `bp-groups/bp-groups-
 actions.php::bp_groups_group_access_protection()`, `$user_has_access` is
 true after line 72, so I'm not sure why access is being prevented.

 Also, in `bp_core_maybe_hook_new_subnav_screen_function()`,
 `$subnav_item['user_has_access']` is true.

 Similarly, as a non-logged-in user, I'm redirected to the login page. I've
 deactivated nearly every plugin and am using a non-BP theme.

 It seems like everything is working correctly, but I'm not getting access.
 What can I do to help troubleshoot?

 I noticed another thing while re-reading the code that I think imath found
 earlier:
 {{{
         public function user_can_visit( $user_can_visit = false ) {
         3496                    if ( 'noone' !== $this->params['show_tab']
 && current_user_can( 'bp_moderate' ) ) {
         3497                            return true;
         3498                    }
         3499
         3500                    return $this->user_can_visit;
         3501            }
 }}}

 I think the first check should be `'noone' !== $this->params['access']`
 ...

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


More information about the buddypress-trac mailing list