Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/16/2011 04:17:14 PM (13 years ago)
Author:
boonebgorges
Message:

Ensure that the BP_Groups_Group object has a user_has_access property set, to avoid errors when posting a forum topic from the Forum Directory. Fixes #3858

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-classes.php

    r5460 r5560  
    4545            $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
    4646            $this->is_member          = BP_Groups_Member::check_is_member( bp_loggedin_user_id(), $this->id );
     47           
     48            // If this is a private or hidden group, does the current user have access?
     49            if ( 'private' == $this->status || 'hidden' == $this->status ) {
     50                if ( $this->is_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) )
     51                    $this->user_has_access = true;
     52                else
     53                    $this->user_has_access = false;
     54            } else {
     55                $this->user_has_access = true;
     56            }
    4757
    4858            // Get group admins and mods
Note: See TracChangeset for help on using the changeset viewer.