function node_query_node_access_alter

Same name in other branches
  1. 9 core/modules/node/node.module \node_query_node_access_alter()
  2. 8.9.x core/modules/node/node.module \node_query_node_access_alter()
  3. 10 core/modules/node/node.module \node_query_node_access_alter()
  4. 11.x core/modules/node/node.module \node_query_node_access_alter()

Implements hook_query_TAG_alter().

This is the hook_query_alter() for queries tagged with 'node_access'. It adds node access checks for the user account given by the 'account' meta-data (or global $user if not provided), for an operation given by the 'op' meta-data (or 'view' if not provided; other possible values are 'update' and 'delete').

Related topics

File

modules/node/node.module, line 3296

Code

function node_query_node_access_alter(QueryAlterableInterface $query) {
    _node_query_node_access_alter($query, 'node');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.