Browse Source

Merge pull request #376 from willtp87/7.x.tn_fix

not bubling permissions
pull/383/head
Mitch MacKenzie 11 years ago
parent
commit
966dd66d38
  1. 7
      islandora.module
  2. 3
      tests/islandora_hooked_access_test.module

7
islandora.module

@ -1439,7 +1439,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__);
@ -1468,10 +1468,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))
);

3
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;
}

Loading…
Cancel
Save