You are here

function og_context_plugin_access_og_perm::access in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og_context/includes/views/handlers/og_context_plugin_access_og_perm.inc \og_context_plugin_access_og_perm::access()

Determine if the current user has access or not.

Overrides views_plugin_access::access

File

og_context/includes/views/og_context_plugin_access_og_perm.inc, line 16
Contains views access plugin for OG permissions

Class

og_context_plugin_access_og_perm
Allow views to allow access to only users with a specified permission in the current group.

Code

function access($account) {

  // Attempt to get the group from the current context and determine if the
  // user has the appropriate permission within the group
  $group = og_context();
  if (!$group) {

    // We should not allow access to the view if we were unable to find a
    // group
    return FALSE;
  }
  return og_user_access($group->gid, $this->options['perm'], $account);
}