function _node_access_join_sql in Drupal 6
Same name and namespace in other branches
- 4 modules/node.module \_node_access_join_sql()
- 5 modules/node/node.module \_node_access_join_sql()
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
1 call to _node_access_join_sql()
- node_db_rewrite_sql in modules/
node/ node.module - Implementation of hook_db_rewrite_sql
File
- modules/
node/ node.module, line 2098 - The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
Code
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';
}