You are here

function biblio_query_node_access_alter in Bibliography Module 7

Same name and namespace in other branches
  1. 7.2 biblio.module \biblio_query_node_access_alter()

File

./biblio.module, line 1234
Bibliography Module for Drupal.

Code

function biblio_query_node_access_alter(QueryAlterableInterface $query) {
  global $user;
  if (user_access('access biblio content', $user)) {
    return;
  }
  $tables = $query
    ->getTables();
  foreach ($tables as $alias => $table_info) {
    if (!$table_info instanceof SelectQueryInterface) {
      if ($table_info['table'] == 'node') {
        $query
          ->condition($alias . '.type', 'biblio', '<>');
        break;
      }
    }
  }
}