Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/content_moderation/content_moderation.views_execution.inc @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
1 <?php | |
2 | |
3 /** | |
4 * @file | |
5 * Provide views runtime hooks for content_moderation.module. | |
6 */ | |
7 | |
8 use Drupal\views\ViewExecutable; | |
9 | |
10 /** | |
11 * Implements hook_views_query_substitutions(). | |
12 */ | |
13 function content_moderation_views_query_substitutions(ViewExecutable $view) { | |
14 $account = \Drupal::currentUser(); | |
15 return [ | |
16 '***VIEW_ANY_UNPUBLISHED_NODES***' => intval($account->hasPermission('view any unpublished content')), | |
17 ]; | |
18 } |