From 54bee2e233c76f7939b118a7474bc359509b11a8 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Tue, 11 Jun 2013 13:56:27 -0300 Subject: [PATCH] Return the final result from the permission anonymous functions. ... Was missing... Also, the handling of an empty array of permissions was happening only implicitly. --- islandora.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/islandora.module b/islandora.module index 3997de63..b4f4ca7a 100644 --- a/islandora.module +++ b/islandora.module @@ -413,7 +413,7 @@ function islandora_user_access($object, array $permissions, $content_models = ar return FALSE; } } - if (!$is_repository_accessible || !is_object($object)) { + if (!$is_repository_accessible || !is_object($object) || empty($permissions)) { return FALSE; } // Determine the user account to test against. @@ -456,6 +456,7 @@ function islandora_user_access($object, array $permissions, $content_models = ar return TRUE; } } + return FALSE; }; $has_required_content_models = empty($content_models) ? TRUE : count(array_intersect($object->models, $content_models)) > 0; } @@ -473,6 +474,7 @@ function islandora_user_access($object, array $permissions, $content_models = ar return FALSE; } } + return TRUE; }; $has_required_content_models = count(array_diff($content_models, $object->models)) == 0; }