diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml index 387c006d04..63586ff3ab 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-service-context.xml @@ -1107,6 +1107,38 @@ + + + + + + org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/security/FilePlanAuthenticationService.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/security/FilePlanAuthenticationService.java new file mode 100644 index 0000000000..72bcc8adaa --- /dev/null +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/security/FilePlanAuthenticationService.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2005-2014 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.security; + +import org.alfresco.repo.security.authentication.AuthenticationUtil; +import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; + +/** + * File plan authentication service. + * + * @author Roy Wetherall + * @since 2.1 + */ +public interface FilePlanAuthenticationService +{ + /** + * @return rm admin user name + * + * @deprecated as of 2.2, use {@link AuthenticationUtil#getAdminUserName()} + */ + String getRmAdminUserName(); + + /** + * Run provided work as the global rm admin user. + * + * @param return type + * @param runAsWork work to execute as the rm admin user + * @return R result of work execution + * + * @deprecated as of 2.2, use {@link AuthenticationUtil#runAs(RunAsWork, AuthenticationUtil#getAdminUserName())} + */ + R runAsRmAdmin(RunAsWork runAsWork); +} diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/security/FilePlanAuthenticationServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/security/FilePlanAuthenticationServiceImpl.java new file mode 100644 index 0000000000..76f036022e --- /dev/null +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/security/FilePlanAuthenticationServiceImpl.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2005-2014 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.security; + +import org.alfresco.repo.security.authentication.AuthenticationUtil; +import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; + +/** + * @author Roy Wetherall + * @since 2.1 + */ +public class FilePlanAuthenticationServiceImpl implements FilePlanAuthenticationService +{ + /** Default rm admin user values */ + @Deprecated + public static final String DEFAULT_RM_ADMIN_USER = "rmadmin"; + + /** + * @see org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService#getRMAdminUserName() + */ + @Override + @Deprecated + public String getRmAdminUserName() + { + return AuthenticationUtil.getAdminUserName(); + } + + /** + * @see org.alfresco.module.org_alfresco_module_rm.security.FilePlanAuthenticationService#runAsRMAdmin(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork) + */ + @Override + @Deprecated + public R runAsRmAdmin(RunAsWork runAsWork) + { + return AuthenticationUtil.runAs(runAsWork, AuthenticationUtil.getAdminUserName()); + } +}