You are here

function og_member_ctools_access_check in Organic groups 7

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

Check for access.

1 string reference to 'og_member_ctools_access_check'
og_member.inc in plugins/access/og_member.inc
Plugin to provide access control based on user group membership.

File

plugins/access/og_member.inc, line 44
Plugin to provide access control based on user group membership.

Code

function og_member_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_is_member($og_group_context->data->gid, 'user', $user_context->data, $conf['state']);
}