From cfa01fdc9162e57bdac7c6029f4500f885c09233 Mon Sep 17 00:00:00 2001 From: Chris Gross <gross.364@osu.edu> Date: Mon, 1 Feb 2016 12:20:13 -0500 Subject: [PATCH] test build --- .../contrib/workbench_moderation/PATCHES.txt | 1 + .../workbench_moderation.install | 7 +++++ .../workbench_moderation.module | 27 +++++++++++++++++++ .../custom/wcm_workbench/wcm_workbench.make | 1 + profiles/wcm_base/wcm_base.install | 3 --- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/profiles/wcm_base/modules/contrib/workbench_moderation/PATCHES.txt b/profiles/wcm_base/modules/contrib/workbench_moderation/PATCHES.txt index 4391a8b7..b468405c 100644 --- a/profiles/wcm_base/modules/contrib/workbench_moderation/PATCHES.txt +++ b/profiles/wcm_base/modules/contrib/workbench_moderation/PATCHES.txt @@ -1,4 +1,5 @@ The following patches have been applied to this project: - http://drupal.org/files/playnicewithpanels-1285090-22.patch +- http://drupal.org/files/issues/view_all_unpublished-1492118-64.patch This file was automatically generated by Drush Make (http://drupal.org/project/drush). \ No newline at end of file diff --git a/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.install b/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.install index 8d68ed32..94c7732f 100644 --- a/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.install +++ b/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.install @@ -670,3 +670,10 @@ function workbench_moderation_update_7010() { db_change_field($table, $field, $field_new, $spec); return t("Renamed 'current' column in node_history table"); } + +/** + * Rebuild access records for all existing content. + */ +function workbench_moderation_update_7011() { + node_access_rebuild(TRUE); +} diff --git a/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.module b/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.module index b2850064..fb6f0b33 100644 --- a/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.module +++ b/profiles/wcm_base/modules/contrib/workbench_moderation/workbench_moderation.module @@ -447,6 +447,33 @@ function workbench_moderation_node_access($node, $op, $account) { return NODE_ACCESS_IGNORE; } +/** + * Implements hook_node_grants(). + */ +function workbench_moderation_node_grants($account, $op) { + // Pass along gid = 1 for any user with unpublished content access. + $grants['workbench_moderation_unpublished'] = array((int) user_access('view all unpublished content', $account)); + return $grants; +} + +/** + * Implements hook_node_access_records(). + */ +function workbench_moderation_node_access_records($node) { + // We only implement an access record for unpublished content. + if (!$node->status) { + $grants[] = array( + 'realm' => 'workbench_moderation_unpublished', + 'gid' => 1, + 'grant_view' => 1, + 'grant_update' => 0, + 'grant_delete' => 0, + 'priority' => 0, + ); + return $grants; + } +} + /** * Custom access handler for node operations. * diff --git a/profiles/wcm_base/modules/custom/wcm_workbench/wcm_workbench.make b/profiles/wcm_base/modules/custom/wcm_workbench/wcm_workbench.make index dac91b01..29356981 100644 --- a/profiles/wcm_base/modules/custom/wcm_workbench/wcm_workbench.make +++ b/profiles/wcm_base/modules/custom/wcm_workbench/wcm_workbench.make @@ -24,3 +24,4 @@ projects[workbench_moderation][type] = module projects[workbench_moderation][download][type] = git projects[workbench_moderation][download][branch] = 7.x-1.x projects[workbench_moderation][patch][2098151] = http://drupal.org/files/playnicewithpanels-1285090-22.patch +projects[workbench_moderation][patch][1492118] = http://drupal.org/files/issues/view_all_unpublished-1492118-64.patch diff --git a/profiles/wcm_base/wcm_base.install b/profiles/wcm_base/wcm_base.install index fb83a6d5..456e8e6b 100644 --- a/profiles/wcm_base/wcm_base.install +++ b/profiles/wcm_base/wcm_base.install @@ -97,7 +97,4 @@ function _wcm_base_set_up_production() { // Cache expiry 15 minutes. variable_set('page_cache_maximum_age', '900'); */ - - // Disable omega development extensions - variable_set('omega_toggle_extension_development', 0); } -- GitLab