Skip to:
Content

BuddyPress.org

Changeset 5560


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

Location:
trunk/bp-groups
Files:
2 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
  • trunk/bp-groups/bp-groups-filters.php

    r5329 r5560  
    131131    if ( bp_current_user_can( 'bp_moderate' ) )
    132132        return true;
    133 
     133   
    134134    if ( 'add_tag_to' == $cap )
    135135        if ( $bp->groups->current_group->user_has_access ) return true;
Note: See TracChangeset for help on using the changeset viewer.