function og_activity_grants in Organic groups 6.2
Implementation of hook_activity_grants().
File
- includes/
og.activity.inc, line 11 - : Provides Activity module hooks for Organic groups.
Code
function og_activity_grants($activity) {
$groups = array();
$grants = array();
if ($activity->type == 'og') {
$groups = array(
$activity->nid,
);
}
elseif (!empty($activity->nid)) {
// Find all the groups the node belongs to.
$node = node_load($activity->nid);
$groups = array_keys(og_get_node_groups($node));
}
if (!empty($groups)) {
$grants = array(
'og_member' => $groups,
);
}
return $grants;
}