You are here

function og_subgroups_og_user_access_alter in Subgroups for Organic groups 7

Same name and namespace in other branches
  1. 7.2 og_subgroups.module \og_subgroups_og_user_access_alter()

Implements hook_og_user_access_alter()

File

./og_subgroups.module, line 95
Enable defining hierarchy of groups for organic groups.

Code

function og_subgroups_og_user_access_alter(&$perm, $context) {

  // Update the permission for a user that tries to access a sub group.
  // This gives to any users his og group permission to all his subgroups,
  // without the -need for him to be a member in the groups.
  $perm[$context['string']] = og_subgroups_get_reverse_hierarchy_tree_perm(array(
    $context['group']->gid,
  ), $context['string'], $context['account']);
}