node_db_rewrite_sql

Definition

node_db_rewrite_sql($query, $primary_table, $primary_field)
modules/node/node.module, line 2154

Description

Implementation of hook_db_rewrite_sql

Related topics

Namesort iconDescription
Node access rightsThe node access system determines who can do what to which nodes.

Code

<?php
function node_db_rewrite_sql($query, $primary_table, $primary_field) {
  if ($primary_field == 'nid' && !node_access_view_all_nodes()) {
    $return['join'] = _node_access_join_sql($primary_table);
    $return['where'] = _node_access_where_sql();
    $return['distinct'] = 1;
    return $return;
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.