function hook_og_access_invoke_node_access_acquire_grants_alter in Organic groups 7.2
Allow modules to mark group privacy change.
Parameters
$result: Array of results of the hooks called before.
array $context: Array with the following keys: 'entity': the group entity. 'entity_type': The group type.
1 invocation of hook_og_access_invoke_node_access_acquire_grants_alter()
- 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 49 - Hooks provided by the Organic groups access module.
Code
function hook_og_access_invoke_node_access_acquire_grants_alter(&$result, $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();
if ($og_access !== $original_og_access) {
$result['my_module'] = TRUE;
}
}