From 5d1e918c3ed2be77dc5703052aeb6100e9996c09 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Wed, 18 Sep 2013 09:15:36 +0000 Subject: [PATCH] RM-972 (RM is not backwards compatible with the Community version) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@55439 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../rm-public-services-security-context.xml | 2 +- .../impl/acegi/RMACLEntryVoter.java | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 rm-server/source/java/org/alfresco/repo/security/permissions/impl/acegi/RMACLEntryVoter.java diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-public-services-security-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-public-services-security-context.xml index 95b0646026..b219f60cf6 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-public-services-security-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-public-services-security-context.xml @@ -65,7 +65,7 @@ - + diff --git a/rm-server/source/java/org/alfresco/repo/security/permissions/impl/acegi/RMACLEntryVoter.java b/rm-server/source/java/org/alfresco/repo/security/permissions/impl/acegi/RMACLEntryVoter.java new file mode 100644 index 0000000000..6ec0bb111b --- /dev/null +++ b/rm-server/source/java/org/alfresco/repo/security/permissions/impl/acegi/RMACLEntryVoter.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2005-2012 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.repo.security.permissions.impl.acegi; + +import java.lang.reflect.Method; + +import org.alfresco.service.cmr.security.OwnableService; + +/** + * This is a workaround to make RM 2.1 backwards compatible with the Community version 4.2.d. + * This class will be removed after Community 4.2.e has been released. + * + * @author Tuna Aksoy + * @since 2.1 + */ +public class RMACLEntryVoter extends ACLEntryVoter +{ + public void setOwnableService(OwnableService ownableService) + { + boolean exists = false; + Method[] declaredMethods = ACLEntryVoter.class.getDeclaredMethods(); + for (Method method : declaredMethods) + { + if (method.getName().equals("setOwnableService")) + { + exists = true; + break; + } + } + if (exists) + { + super.setOwnableService(ownableService); + } + } +}