From d7645ce1e7c562a3b246bb9ed82678a08eeb84de Mon Sep 17 00:00:00 2001 From: William Panting Date: Thu, 1 Aug 2013 16:41:18 -0300 Subject: [PATCH 1/2] not bubling permissions --- islandora.module | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/islandora.module b/islandora.module index 5b45fb1a..e618c021 100644 --- a/islandora.module +++ b/islandora.module @@ -1317,7 +1317,7 @@ function islandora_islandora_object_access($op, $object, $user) { /** * Hookable access callback for datastreams. * - * Requires the equivalent permissions on the object. + * Positive permissions on object access suggests on the datastream. */ function islandora_datastream_access($op, $datastream, $user = NULL) { $cache = &drupal_static(__FUNCTION__); @@ -1346,10 +1346,9 @@ function islandora_datastream_access($op, $datastream, $user = NULL) { $user, )); - // Neither the object nor the datastream check returned FALSE, and one in - // the object or datastream checks returned TRUE. + // The datastream check returned FALSE, and one in the object or datastream + // checks returned TRUE. $cache[$op][$datastream->parent->id][$datastream->id][$user->uid] = ( - !in_array(FALSE, $object_results, TRUE) && !in_array(FALSE, $datastream_results, TRUE) && (in_array(TRUE, $object_results, TRUE) || in_array(TRUE, $datastream_results, TRUE)) ); From aba19555cae618000fdc5eb87033a2160baacbec Mon Sep 17 00:00:00 2001 From: William Panting Date: Tue, 13 Aug 2013 12:05:27 -0300 Subject: [PATCH 2/2] test working again --- tests/islandora_hooked_access_test.module | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/islandora_hooked_access_test.module b/tests/islandora_hooked_access_test.module index de417738..e69fc1cc 100644 --- a/tests/islandora_hooked_access_test.module +++ b/tests/islandora_hooked_access_test.module @@ -23,6 +23,9 @@ function islandora_hooked_access_test_islandora_object_access($op, $object, $use * Implements hook_islandora_datastream_access(). */ function islandora_hooked_access_test_islandora_datastream_access($op, $datastream, $user) { + if ($op == FEDORA_PURGE) { + return FALSE; + } if (isset($_SESSION['islandora_hooked_access_test']) && $_SESSION['islandora_hooked_access_test'] === func_get_args()) { return TRUE; }