Mercurial > hg > cmmr2012-drupal-site
annotate 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 |
rev | line source |
---|---|
Chris@5 | 1 <?php |
Chris@5 | 2 |
Chris@5 | 3 /** |
Chris@5 | 4 * @file |
Chris@5 | 5 * Provide views runtime hooks for content_moderation.module. |
Chris@5 | 6 */ |
Chris@5 | 7 |
Chris@5 | 8 use Drupal\views\ViewExecutable; |
Chris@5 | 9 |
Chris@5 | 10 /** |
Chris@5 | 11 * Implements hook_views_query_substitutions(). |
Chris@5 | 12 */ |
Chris@5 | 13 function content_moderation_views_query_substitutions(ViewExecutable $view) { |
Chris@5 | 14 $account = \Drupal::currentUser(); |
Chris@5 | 15 return [ |
Chris@5 | 16 '***VIEW_ANY_UNPUBLISHED_NODES***' => intval($account->hasPermission('view any unpublished content')), |
Chris@5 | 17 ]; |
Chris@5 | 18 } |