_node_access_join_sql

Versions
4.6 – 6
_node_access_join_sql($node_alias = 'n', $node_access_alias = 'na')

Generate an SQL join clause for use in fetching a node listing.

Parameters

$node_alias If the node table has been given an SQL alias other than the default "n", that must be passed here.

$node_access_alias If the node_access table has been given an SQL alias other than the default "na", that must be passed here.

Return value

An SQL join clause.

Related topics

Code

modules/node/node.module, line 2072

<?php
function _node_access_join_sql($node_alias = 'n', $node_access_alias = 'na') {
  if (user_access('administer nodes')) {
    return '';
  }

  return 'INNER JOIN {node_access} '. $node_access_alias .' ON '. $node_access_alias .'.nid = '. $node_alias .'.nid';
}
?>
Login or register to post comments
 
 

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.