node_views_query_substitutions

node_views_query_substitutions(ViewExecutable $view)

Implements hook_views_query_substitutions().

File

core/modules/node/node.views_execution.inc, line 15
Provide views runtime hooks for node.module.

Code

function node_views_query_substitutions(ViewExecutable $view) {
  $account = \Drupal::currentUser();
  return array(
    '***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')),
  );
}
doc_Drupal
2016-10-29 09:32:01
Comments
Leave a Comment

Please login to continue.