You are here

function og_vocab_term_page_access in OG Vocabulary 7

Determince access to term page if term belongs to a vocabulary owned by OG-vocab.

Parameters

$term: The taxonomy term object.

3 string references to 'og_vocab_term_page_access'
og_vocab_admin_settings in includes/og_vocab.admin.inc
Admin form settings.
og_vocab_admin_settings_submit in includes/og_vocab.admin.inc
Submit handler; Re-build the menu tree.
og_vocab_menu_alter in ./og_vocab.module
Implements hook_menu_alter().

File

./og_vocab.module, line 131
Give each group its own system controlled vocabularies.

Code

function og_vocab_term_page_access($term) {
  if (!user_access('access content')) {
    return;
  }
  if (!($relation = og_vocab_relation_get($term->vid))) {

    // Term doesn't belong to OG-vocab
    return TRUE;
  }

  // Check if user has access to the group.
  $group = entity_load_single($relation->group_type, $relation->gid);
  return entity_access('view', $relation->group_type, $group);
}