diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java
index 1a4403e581..7bcad6f0c9 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/fileplan/FilePlanServiceImpl.java
@@ -178,8 +178,8 @@ public class FilePlanServiceImpl extends ServiceBaseImpl
public boolean isFilePlanComponent(NodeRef nodeRef)
{
boolean result = false;
- if (nodeService.exists(nodeRef) == true &&
- nodeService.hasAspect(nodeRef, ASPECT_FILE_PLAN_COMPONENT) == true)
+ if (getInternalNodeService().exists(nodeRef) == true &&
+ getInternalNodeService().hasAspect(nodeRef, ASPECT_FILE_PLAN_COMPONENT) == true)
{
result = true;
}
diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/AllTestSuite.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/AllTestSuite.java
index fb84ea4eae..0a3a9e7273 100644
--- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/AllTestSuite.java
+++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/AllTestSuite.java
@@ -35,7 +35,8 @@ import org.junit.runners.Suite.SuiteClasses;
ActionTestSuite.class,
CapabilitiesTestSuite.class,
ServicesTestSuite.class,
- WebScriptTestSuite.class
+ WebScriptTestSuite.class,
+ IssueTestSuite.class
})
public class AllTestSuite
{
diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/IssueTestSuite.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/IssueTestSuite.java
new file mode 100644
index 0000000000..70d39b089f
--- /dev/null
+++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/IssueTestSuite.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2005-2011 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+package org.alfresco.module.org_alfresco_module_rm.test;
+
+import org.alfresco.module.org_alfresco_module_rm.test.issue.RM452Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * Issue test suite
+ *
+ * @author Roy Wetherall
+ * @since 2.1
+ */
+@RunWith(Suite.class)
+@SuiteClasses(
+{
+ RM452Test.class
+})
+public class IssueTestSuite
+{
+}
diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/issue/RM452Test.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/issue/RM452Test.java
new file mode 100644
index 0000000000..d22a0ec0a8
--- /dev/null
+++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/issue/RM452Test.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2005-2011 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+package org.alfresco.module.org_alfresco_module_rm.test.issue;
+
+import org.alfresco.error.AlfrescoRuntimeException;
+import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase;
+import org.alfresco.module.org_alfresco_module_rm.test.util.TestService;
+
+
+/**
+ * System test for RM-452
+ *
+ * See alfresco.extension.rm-method-security.properties
+ *
+ * @author Roy Wetherall
+ */
+public class RM452Test extends BaseRMTestCase
+{
+ private TestService testService;
+
+ @Override
+ protected void initServices()
+ {
+ super.initServices();
+
+ testService = (TestService)applicationContext.getBean("TestService");
+ }
+
+ @Override
+ protected boolean isCollaborationSiteTest()
+ {
+ return true;
+ }
+
+ @Override
+ protected boolean isRecordTest()
+ {
+ return true;
+ }
+
+ public void testRM452() throws Exception
+ {
+ doTestInTransaction(new Test()
+ {
+ @Override
+ public Void run()
+ {
+ assertNotNull(folder);
+ assertNotNull(recordOne);
+ assertFalse(filePlanService.isFilePlanComponent(folder));
+ assertTrue(filePlanService.isFilePlanComponent(recordOne));
+
+ // call methodOne with non-RM artifact .. expect success
+ testService.testMethodOne(folder);
+
+ // call methodTwo with non-RM artifact .. expect success
+ testService.testMethodTwo(folder);
+
+ // call methodOne with an RM artifact .. expect success
+ testService.testMethodOne(recordOne);
+
+ return null;
+ }
+ });
+
+ doTestInTransaction(new FailureTest
+ (
+ "Shouldn't be able to call testMethodTwo on TestService, because override RM security for method is not configred.",
+ AlfrescoRuntimeException.class
+ )
+ {
+
+ @Override
+ public void run() throws Exception
+ {
+ // call methodTwo with an RM artifact .. expect failure
+ testService.testMethodTwo(recordOne);
+ }
+ });
+ }
+}
diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/TestService.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/TestService.java
new file mode 100644
index 0000000000..5a3942d30c
--- /dev/null
+++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/TestService.java
@@ -0,0 +1,11 @@
+package org.alfresco.module.org_alfresco_module_rm.test.util;
+
+import org.alfresco.service.cmr.repository.NodeRef;
+
+public interface TestService
+{
+ void testMethodOne(NodeRef nodeRef);
+
+ void testMethodTwo(NodeRef nodeRef);
+
+}
diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/TestServiceImpl.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/TestServiceImpl.java
new file mode 100644
index 0000000000..111ec12722
--- /dev/null
+++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/util/TestServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2005-2013 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+package org.alfresco.module.org_alfresco_module_rm.test.util;
+
+import org.alfresco.service.cmr.repository.NodeRef;
+
+/**
+ * @author Roy Wetherall
+ * @since 2.1
+ */
+public class TestServiceImpl implements TestService
+{
+ @Override
+ public void testMethodOne(NodeRef nodeRef)
+ {
+ }
+
+ @Override
+ public void testMethodTwo(NodeRef nodeRef)
+ {
+ }
+}
diff --git a/rm-server/test/resources/alfresco/extension/rm-method-security.properties b/rm-server/test/resources/alfresco/extension/rm-method-security.properties
new file mode 100644
index 0000000000..f1427d4545
--- /dev/null
+++ b/rm-server/test/resources/alfresco/extension/rm-method-security.properties
@@ -0,0 +1,2 @@
+rm.methodsecurity.org.alfresco.module.org_alfresco_module_rm.test.util.TestService.testMethodOne=RM_ALLOW
+rm.methodsecurity.org.alfresco.module.org_alfresco_module_rm.test.util.TestService.*=RM_DENY
\ No newline at end of file
diff --git a/rm-server/test/resources/test-context.xml b/rm-server/test/resources/test-context.xml
index 9e137f05d3..b1955bc387 100644
--- a/rm-server/test/resources/test-context.xml
+++ b/rm-server/test/resources/test-context.xml
@@ -180,5 +180,39 @@
+
+
+
+
+
+
+
+ org.alfresco.module.org_alfresco_module_rm.test.util.TestService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file