2013-04-10 20:12:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Provide views runtime hooks for node.module.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use Drupal\views\ViewExecutable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements hook_views_query_substitutions().
|
|
|
|
*/
|
|
|
|
function node_views_query_substitutions(ViewExecutable $view) {
|
Issue #2061977 by InternetDevels, kim.pepper, ianthomas_uk, herom, rhm50, naveenvalecha, andypost, mandar.harkare, sergeypavlenko, sidharthap, SIz, tkuldeep17: Replace user_access() calls with ->hasPermission() in all core modules except user.
2014-07-12 06:55:56 +00:00
|
|
|
$account = \Drupal::currentUser();
|
2017-03-04 01:20:24 +00:00
|
|
|
return [
|
Issue #2061977 by InternetDevels, kim.pepper, ianthomas_uk, herom, rhm50, naveenvalecha, andypost, mandar.harkare, sergeypavlenko, sidharthap, SIz, tkuldeep17: Replace user_access() calls with ->hasPermission() in all core modules except user.
2014-07-12 06:55:56 +00:00
|
|
|
'***ADMINISTER_NODES***' => intval($account->hasPermission('administer nodes')),
|
|
|
|
'***VIEW_OWN_UNPUBLISHED_NODES***' => intval($account->hasPermission('view own unpublished content')),
|
2016-04-29 11:02:20 +00:00
|
|
|
'***BYPASS_NODE_ACCESS***' => intval($account->hasPermission('bypass node access')),
|
2017-03-04 01:20:24 +00:00
|
|
|
];
|
2013-04-10 20:12:01 +00:00
|
|
|
}
|