You are here

function space_og::access_feature in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 spaces_og/plugins/space_og.inc \space_og::access_feature()
  2. 7 spaces_og/plugins/space_og.inc \space_og::access_feature()

Override of access_feature().

Overrides space_type::access_feature

File

spaces_og/plugins/space_og.inc, line 79

Class

space_og
Organic groups integration for Spaces.

Code

function access_feature($op = 'view', $feature, $account = NULL) {
  $access = parent::access_feature($op, $feature, $account);
  global $user;
  $account = isset($account) ? $account : $user;

  // Only allow access if: user can administer OG, group is public,
  // or user is a member.
  $access = $access && (user_access('administer organic groups') || !$this->group->og_private || og_is_group_member($this->id, TRUE, $account->uid));

  // Additional check for group membership if authoring content in this group.
  if ($op === 'create') {
    return $access && og_is_group_member($this->id, TRUE, $account->uid);
  }
  return $access;
}