You are here

function og_perm_ctools_access_check in Organic groups 7

Same name and namespace in other branches
  1. 7.2 plugins/access/og_perm.inc \og_perm_ctools_access_check()

Check for access.

1 string reference to 'og_perm_ctools_access_check'
og_perm.inc in plugins/access/og_perm.inc
Plugin to provide access control based on user permission strings in a group.

File

plugins/access/og_perm.inc, line 52
Plugin to provide access control based on user permission strings in a group.

Code

function og_perm_ctools_access_check($conf, $context) {

  // As far as I know there should always be a context at this point, but this
  // is safe.
  list($user_context, $og_group_context) = $context;
  if (empty($user_context) || empty($user_context->data)) {
    return FALSE;
  }
  if (empty($og_group_context) || empty($og_group_context->data) || empty($og_group_context->data->gid)) {
    return FALSE;
  }
  return og_user_access($og_group_context->data->gid, $conf['perm'], $user_context->data);
}