From b605635eb6ebe8138c73dc09291827ac56f45ce0 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Tue, 10 Mar 2015 04:32:04 +0000 Subject: [PATCH] Merged HEAD to V2.2: 89735: RM-1677- No items error for RM Admin if record was declared from moderated/private site * fixes RM-2018 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2@99089 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../jscript/app/JSONConversionComponent.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java index 186409450f..82b94f8fd0 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java @@ -294,7 +294,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC if (originatingLocation != null) { String pathSeparator = "/"; - String displayPath = PathUtil.getDisplayPath(nodeService.getPath(originatingLocation), true); + String displayPath = getDisplayPath(originatingLocation); String[] displayPathElements = displayPath.split(pathSeparator); Object[] subPath = ArrayUtils.subarray(displayPathElements, 5, displayPathElements.length); StringBuffer originatingLocationPath = new StringBuffer(); @@ -305,6 +305,23 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC rootJSONObject.put("originatingLocationPath", originatingLocationPath.toString()); } } + + /** + * Helper method to get the display path. + * + * @param nodeRef node reference + * @return String display path + */ + private String getDisplayPath(final NodeRef nodeRef) + { + return AuthenticationUtil.runAs(new RunAsWork() + { + public String doWork() throws Exception + { + return PathUtil.getDisplayPath(nodeService.getPath(nodeRef), true); + } + }, AuthenticationUtil.getAdminUserName()); + } /** * @param nodeRef