diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/content_moderation/content_moderation.views_execution.inc	Thu May 09 15:34:47 2019 +0100
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * Provide views runtime hooks for content_moderation.module.
+ */
+
+use Drupal\views\ViewExecutable;
+
+/**
+ * Implements hook_views_query_substitutions().
+ */
+function content_moderation_views_query_substitutions(ViewExecutable $view) {
+  $account = \Drupal::currentUser();
+  return [
+    '***VIEW_ANY_UNPUBLISHED_NODES***' => intval($account->hasPermission('view any unpublished content')),
+  ];
+}