You are here

function tvi_render_view_access in Taxonomy Views Integrator 7

Same name and namespace in other branches
  1. 6 tvi.module \tvi_render_view_access()

Check access for the current taxonomy page.

We start off by checking view overrides, then take the normal permission for taxonomy/term pages, if no view is found.

Parameters

int|object $tid: The term tid or the term object.

Return value

bool TRUE if the user can access the current taxonomy page.

1 string reference to 'tvi_render_view_access'
tvi_menu_alter in ./tvi.module
Implements hook_menu_alter().

File

./tvi.module, line 281
Allow to define views to be used instead of default drupal behavior on taxonomy terms pages.

Code

function tvi_render_view_access($tid) {
  if (is_object($tid)) {
    $tid = $tid->tid;
  }
  list($view, $display) = tvi_get_view_info($tid);
  if (is_object($view) && $display) {
    if ($view
      ->access($display)) {
      return TRUE;
    }
    return FALSE;
  }
  return user_access('access content');
}