From d5031599faa293cd5d4af2d504fb72ad5405a050 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Tue, 5 Apr 2016 14:38:36 +1000 Subject: [PATCH] RM-3181 and RM-3195 - error accessing caveatConfig.json after modifications Caveat config file had filePlanComponent applied, but wasn't contained within a file plan. --- .../module/org_alfresco_module_rm/model/recordsModel.xml | 3 --- .../org_alfresco_module_rm/capability/RMSecurityCommon.java | 3 ++- .../jscript/app/JSONConversionComponent.java | 5 ++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml index e4957c7b11..27ca16ccef 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/model/recordsModel.xml @@ -41,9 +41,6 @@ Caveat Config cm:content false - - rma:filePlanComponent - diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java index 3c8aa1c519..fc5593c6fa 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/capability/RMSecurityCommon.java @@ -244,7 +244,8 @@ public class RMSecurityCommon implements ApplicationContextAware { // Get the file plan for the node NodeRef filePlan = getFilePlanService().getFilePlan(nodeRef); - if (hasViewCapability(filePlan) == AccessStatus.DENIED) + if (filePlan != null && + hasViewCapability(filePlan) == AccessStatus.DENIED) { if (logger.isDebugEnabled()) { diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java index cb76d4951e..b7ea5e12d2 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java @@ -411,7 +411,10 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS // File plan node reference NodeRef filePlan = filePlanService.getFilePlan(nodeRef); - result.put("filePlan", filePlan.toString()); + if (filePlan != null) + { + result.put("filePlan", filePlan.toString()); + } // Unfiled container node reference NodeRef unfiledRecordContainer = filePlanService.getUnfiledContainer(filePlan);