From b1479d5af78e909783aca21b9df708798ad980a1 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 11 Jun 2013 13:50:07 -0300 Subject: [PATCH] Revert "Pass the content models..." This reverts commit 2a654d6e837c4c8809d22b99bed731c1dc847e70... The content models weren't needed or used... Messed up matching braces in my head. Conflicts: islandora.module --- islandora.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/islandora.module b/islandora.module index 0a676c76..3997de63 100644 --- a/islandora.module +++ b/islandora.module @@ -443,7 +443,7 @@ function islandora_user_access($object, array $permissions, $content_models = ar // Check for access. if ($access_any) { - $has_required_permissions = function ($permissions, $content_models, $datastream, $object, $user) { + $has_required_permissions = function ($permissions, $datastream, $object, $user) { foreach ($permissions as $p) { if ($datastream !== NULL) { $check = islandora_datastream_access($p, $datastream, $user); @@ -457,10 +457,10 @@ function islandora_user_access($object, array $permissions, $content_models = ar } } }; - $has_required_content_models = empty($content_models) ? TRUE : (count(array_intersect($object->models, $content_models)) > 0); + $has_required_content_models = empty($content_models) ? TRUE : count(array_intersect($object->models, $content_models)) > 0; } else { - $has_required_permissions = function ($permissions, $content_models, $datastream, $object, $user) { + $has_required_permissions = function ($permissions, $datastream, $object, $user) { foreach ($permissions as $p) { if ($datastream !== NULL) { $check = islandora_datastream_access($p, $datastream, $user); @@ -477,7 +477,7 @@ function islandora_user_access($object, array $permissions, $content_models = ar $has_required_content_models = count(array_diff($content_models, $object->models)) == 0; } - return $has_required_permissions($permissions, $content_models, $datastream, $object, $account) && + return $has_required_permissions($permissions, $datastream, $object, $account) && $has_required_content_models; }