You are here

function og_access_og_access_invoke_node_access_acquire_grants in Organic groups 7.2

Implements hook_og_access_invoke_node_access_acquire_grants().

Simple check whether OG_ACCESS_FIELD values was changed.

File

og_access/og_access.module, line 270
Enable access control for private and public groups and group content.

Code

function og_access_og_access_invoke_node_access_acquire_grants($context) {
  $wrapper = entity_metadata_wrapper($context['entity_type'], $context['entity']);
  if (!isset($wrapper->{OG_ACCESS_FIELD})) {

    // Group doesn't have OG access field attached to it.
    return;
  }
  $original_wrapper = entity_metadata_wrapper($context['entity_type'], $context['entity']->original);
  $og_access = $wrapper->{OG_ACCESS_FIELD}
    ->value();
  $original_og_access = $original_wrapper->{OG_ACCESS_FIELD}
    ->value();
  return $og_access !== $original_og_access;
}