function node_views_query_substitutions

Same name in other branches
  1. 8.9.x core/modules/node/node.views_execution.inc \node_views_query_substitutions()
  2. 10 core/modules/node/node.views_execution.inc \node_views_query_substitutions()
  3. 11.x core/modules/node/node.views_execution.inc \node_views_query_substitutions()

Implements hook_views_query_substitutions().

File

core/modules/node/node.views_execution.inc, line 13

Code

function node_views_query_substitutions(ViewExecutable $view) {
    $account = \Drupal::currentUser();
    return [
        '***ADMINISTER_NODES***' => intval($account->hasPermission('administer nodes')),
        '***VIEW_OWN_UNPUBLISHED_NODES***' => intval($account->hasPermission('view own unpublished content')),
        '***BYPASS_NODE_ACCESS***' => intval($account->hasPermission('bypass node access')),
    ];
}

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