summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkenneth.venken2017-07-07 16:06:07 (GMT)
committerRenato Goncalves de Araujo2017-07-07 16:06:07 (GMT)
commit3ae6434a74e0e32b1fdac251b3ef22566217e555 (patch)
tree17a55162993c32ae0517638c051f9206b1d19c26
parentdf12780a5da01d10b48e301fdff275f0602e1bf2 (diff)
Issue #1535716 by kenneth.venken, RenatoG, alfaguru, gauravjeet: Workbench moderation 'all unpublished content' permission support.
-rw-r--r--node_reference/node_reference.module7
1 files changed, 4 insertions, 3 deletions
diff --git a/node_reference/node_reference.module b/node_reference/node_reference.module
index e726833..6480f6c 100644
--- a/node_reference/node_reference.module
+++ b/node_reference/node_reference.module
@@ -234,9 +234,10 @@ function node_reference_field_prepare_view($entity_type, $entities, $field, $ins
->condition('n.nid', $ids_to_check, 'IN');
// Unless the user has the right permissions, restrict on the node status.
- // (note: the 'view any unpublished content' permission is provided by the
- // 'view_unpublished' contrib module.)
- if (!user_access('bypass node access') && !user_access('view any unpublished content')) {
+ // 'view_unpublished' contrib module and the
+ // 'view all unpublished content'
+ // permission is provided by the 'workbench_moderation' contrib module.)
+ if (!user_access('bypass node access') && !user_access('view any unpublished content') && !user_access('view all unpublished content')) {
// ... AND n.status = 1.
$status_condition = db_or()
->condition('n.status', NODE_PUBLISHED);