From 0b80b960b8470f67ba93348eb1228ddee71f39f3 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 5 Jan 2006 08:28:39 +0000 Subject: [PATCH] . Fix to Permissions Cache to handle deleted nodes in correct order (i.e. before accessing the cache) - fixes issue highlighted by ACLEntryVoterTest git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2076 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../permissions/impl/PermissionServiceImpl.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/source/java/org/alfresco/repo/security/permissions/impl/PermissionServiceImpl.java b/source/java/org/alfresco/repo/security/permissions/impl/PermissionServiceImpl.java index 8a05581974..28c29d759c 100644 --- a/source/java/org/alfresco/repo/security/permissions/impl/PermissionServiceImpl.java +++ b/source/java/org/alfresco/repo/security/permissions/impl/PermissionServiceImpl.java @@ -328,19 +328,23 @@ public class PermissionServiceImpl implements PermissionServiceSPI, Initializing // If the node ref is null there is no sensible test to do - and there // must be no permissions // - so we allow it - if (nodeRef == null) { return AccessStatus.ALLOWED; } // If the permission is null we deny - if (perm == null) { return AccessStatus.DENIED; } - + + // Allow permissions for nodes that do not exist + if (!nodeService.exists(nodeRef)) + { + return AccessStatus.ALLOWED; + } + // Get the current authentications // Use the smart authentication cache to improve permissions performance Authentication auth = authenticationComponent.getCurrentAuthentication(); @@ -355,13 +359,6 @@ public class PermissionServiceImpl implements PermissionServiceSPI, Initializing return status; } - // Allow permissions for nodes that do not exist - if (!nodeService.exists(nodeRef)) - { - accessCache.put(key, AccessStatus.ALLOWED); - return AccessStatus.ALLOWED; - } - // If the node does not support the given permission there is no point // doing the test Set available = modelDAO.getAllPermissions(nodeRef);