You are here

function hook_og_access_invoke_node_access_acquire_grants in Organic groups 7.2

Allow modules to mark group privacy change.

Parameters

array $context: Array with the following keys: 'entity': the group entity. 'entity_type': The group type.

Return value

bool TRUE if group privacy has been changed.

1 function implements hook_og_access_invoke_node_access_acquire_grants()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

og_access_og_access_invoke_node_access_acquire_grants in og_access/og_access.module
Implements hook_og_access_invoke_node_access_acquire_grants().
1 invocation of hook_og_access_invoke_node_access_acquire_grants()
og_access_check_node_access_grants_is_needed in og_access/og_access.module
Check whether group access changed that require batch processing.

File

og_access/og_access.api.php, line 25
Hooks provided by the Organic groups access module.

Code

function hook_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;
}