From 728a5bd7bbffde005848c66870ad13e62386ed5d Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Thu, 13 Feb 2014 20:56:28 +0000 Subject: [PATCH] Ensure create category behaviour is executed with sufficient rights. * fixes FileToCreatePathIntegration test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@62554 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../model/rma/type/RecordCategoryType.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordCategoryType.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordCategoryType.java index 5b8737b449..40b407a4fd 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordCategoryType.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordCategoryType.java @@ -154,15 +154,26 @@ public class RecordCategoryType extends BaseBehaviourBean kind = BehaviourKind.CLASS, notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT ) - public void onCreateNode(ChildAssociationRef childAssocRef) + public void onCreateNode(final ChildAssociationRef childAssocRef) { if (logger.isDebugEnabled() == true) { logger.debug("rma:recordCategory|alf:onCreateNode|this.onCreateNode()|TRANSATION_COMMIT"); } - // setup record category permissions - filePlanPermissionService.setupRecordCategoryPermissions(childAssocRef.getChildRef()); + // execute behaviour code as system user + AuthenticationUtil.runAsSystem(new RunAsWork() + { + @Override + public Void doWork() throws Exception + { + // setup record category permissions + filePlanPermissionService.setupRecordCategoryPermissions(childAssocRef.getChildRef()); + + return null; + } + }); + } /**