From 03e696e5246c628756b5851c829b39b4afcf40e4 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Thu, 25 Jun 2015 22:45:52 +0000 Subject: [PATCH] RM-2130 (Check classification after method execution, filtering results where appropriate) +review RM-94 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/DEV/ENFORCE@107164 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../classified-content-context.xml | 18 ++++-- .../BasePostMethodInvocationProcessor.java | 64 +++++++++++++++++++ 2 files changed, 75 insertions(+), 7 deletions(-) diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml index 0fb83bd483..19a684a701 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/classified-content-context.xml @@ -1,12 +1,12 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:aop="http://www.springframework.org/schema/aop" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/aop + http://www.springframework.org/schema/aop/spring-aop-3.0.xsd "> @@ -60,13 +60,17 @@ + + + + , Pair> cache; + /** * @return the nodeService */ @@ -71,6 +80,14 @@ public abstract class BasePostMethodInvocationProcessor return this.contentClassificationService; } + /** + * @return the securityClearanceService + */ + protected SecurityClearanceService getSecurityClearanceService() + { + return this.securityClearanceService; + } + /** * @return the postMethodInvocationProcessor */ @@ -79,6 +96,14 @@ public abstract class BasePostMethodInvocationProcessor return this.postMethodInvocationProcessor; } + /** + * @return the cache + */ + protected SimpleCache, Pair> getCache() + { + return this.cache; + } + /** * @param nodeService the nodeService to set */ @@ -103,6 +128,14 @@ public abstract class BasePostMethodInvocationProcessor this.contentClassificationService = contentClassificationService; } + /** + * @param securityClearanceService the securityClearanceService to set + */ + public void setSecurityClearanceService(SecurityClearanceService securityClearanceService) + { + this.securityClearanceService = securityClearanceService; + } + /** * @param postMethodInvocationProcessor the postMethodInvocationProcessor to set */ @@ -111,6 +144,14 @@ public abstract class BasePostMethodInvocationProcessor this.postMethodInvocationProcessor = postMethodInvocationProcessor; } + /** + * @param cache the cache to set + */ + public void setCache(SimpleCache, Pair> cache) + { + this.cache = cache; + } + /** * Gets the class name * @@ -164,6 +205,29 @@ public abstract class BasePostMethodInvocationProcessor filter = null; } +// if (filter != null) +// { +// String uniqueCacheKey = getFullyAuthenticatedUser() /*+ userClearance?*/; +// +// Pair cacheKey = new Pair(uniqueCacheKey, filter); +// Pair cacheValue = getCache().get(cacheKey); +// +// if (cacheValue == null || !cacheValue.getFirst().booleanValue()) +// { +// if (getNodeService().exists(nodeRef) && +// getDictionaryService().isSubClass(getNodeService().getType(nodeRef), TYPE_CONTENT) && +// !getContentClassificationService().hasClearance(nodeRef)) +// { +// filter = null; +// } +// getCache().put(new Pair(uniqueCacheKey, nodeRef), new Pair(true, filter)); +// } +// else +// { +// filter = getCache().get(cacheKey).getSecond(); +// } +// } + return filter; } }