diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-disposition-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-disposition-context.xml index bfe78ec87b..2688b3c450 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-disposition-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/capability/rm-capabilities-disposition-context.xml @@ -3,7 +3,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -137,6 +137,26 @@ + + + + + + + TRANSFER + + + + + + + + + + + + - + diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/capability-service.properties b/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/capability-service.properties index 38f3346254..52817f04cc 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/capability-service.properties +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/messages/capability-service.properties @@ -54,6 +54,8 @@ capability.DestroyRecordsScheduledForDestruction.title=Destroy Records Scheduled capability.DestroyRecords.title=Destroy Records capability.DeleteRecords.title=Delete Records capability.TriggerAnEvent.title=Trigger An Event +capability.FileDestructionReport.title=File Destruction Report +capability.FileTransferReport.title=File Transfer Report # Hold Controls capability.group.holdControls.title=Hold Controls diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsPermissionModel.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsPermissionModel.xml index 1f8807b4ce..d8837a25e7 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsPermissionModel.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/model/recordsPermissionModel.xml @@ -3,17 +3,17 @@ - + - + - + - + @@ -78,7 +78,7 @@ - + @@ -87,16 +87,18 @@ + + - + - + - + @@ -156,9 +158,9 @@ - + - + @@ -166,279 +168,286 @@ - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + - + - + - + - + \ No newline at end of file diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-patch-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-patch-context.xml index 89748b746c..e64be41bde 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-patch-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-patch-context.xml @@ -3,198 +3,219 @@ + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml index d2aa0758e6..1ccdc2d8ad 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-report-context.xml @@ -115,8 +115,7 @@ - - org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_ALLOW + org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.FileTransferReport org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml index fbec50a811..e93bccb8e6 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/rm-ui-evaluators-context.xml @@ -426,6 +426,17 @@ + + + + + TRANSFER + + + + + @@ -613,11 +624,6 @@ - - - - diff --git a/rm-server/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json b/rm-server/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json index 1b35b40b58..63bdbfce25 100644 --- a/rm-server/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json +++ b/rm-server/config/alfresco/module/org_alfresco_module_rm/security/rm-default-roles-bootstrap.json @@ -83,7 +83,7 @@ "capabilities" : [ "DeclareRecords", - "ViewRecords", + "ViewRecords", "CreateRecords", "CreateModifyDestroyFolders", "EditRecordMetadata", @@ -137,13 +137,14 @@ "FileDestructionReport", "FileUnfiledRecords", "RejectRecords", - "LinkToRecords" + "LinkToRecords", + "FileTransferReport" ] }, { "name" : "Administrator", "displayLabel" : "rm.role.administrator", - "isAdmin" : true, + "isAdmin" : true, "capabilities" : [ "DeclareRecords", @@ -203,7 +204,8 @@ "FileDestructionReport", "FileUnfiledRecords", "RejectRecords", - "LinkToRecords" + "LinkToRecords", + "FileTransferReport" ] } ] diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/BaseRMCapabilityPatch.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/BaseRMCapabilityPatch.java new file mode 100644 index 0000000000..2f2263b7af --- /dev/null +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/BaseRMCapabilityPatch.java @@ -0,0 +1,120 @@ +/* + * 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.patch; + +import java.util.Set; + +import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.module.org_alfresco_module_rm.capability.Capability; +import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; +import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; +import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService; +import org.alfresco.module.org_alfresco_module_rm.role.Role; +import org.alfresco.service.cmr.repository.NodeRef; + +/** + * Base class for the capability patch classes + * + * @author Tuna Aksoy + * @since 2.2 + */ +public abstract class BaseRMCapabilityPatch extends ModulePatchComponent +{ + /** File plan service */ + private FilePlanService filePlanService; + + /** File plan role service */ + private FilePlanRoleService filePlanRoleService; + + /** Capability service */ + private CapabilityService capabilityService; + + /** + * @param filePlanRoleService file plan role service + */ + public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService) + { + this.filePlanRoleService = filePlanRoleService; + } + + /** + * @param capabilityService capability service + */ + public void setCapabilityService(CapabilityService capabilityService) + { + this.capabilityService = capabilityService; + } + + /** + * @param filePlanService file plan service + */ + public void setFilePlanService(FilePlanService filePlanService) + { + this.filePlanService = filePlanService; + } + + /** + * Helper method to get the file plans + * + * @return Set of file plan node references + */ + protected Set getFilePlans() + { + return filePlanService.getFilePlans(); + } + + /** + * Adds a new capability to the specified roles. + * + * @param filePlan file plan + * @param capabilityName capability name + * @param roles roles + */ + protected void addCapability(NodeRef filePlan, String capabilityName, String ... roles) + { + Capability capability = capabilityService.getCapability(capabilityName); + if (capability == null) + { + throw new AlfrescoRuntimeException("Unable to bootstrap RMv21 capabilities, because capability " + capabilityName + " does not exist."); + } + + for (String roleName : roles) + { + Role role = filePlanRoleService.getRole(filePlan, roleName); + + if (role != null) + { + // get the roles current capabilities + Set capabilities = role.getCapabilities(); + + // only update if the capability is missing + if (capabilities.contains(capability) == false) + { + if (logger.isDebugEnabled() == true) + { + logger.debug(" ... adding capability " + capabilityName + " to role " + role.getName()); + } + + capabilities.add(capability); + filePlanRoleService.updateRole(filePlan, role.getName(), role.getDisplayLabel(), capabilities); + } + } + } + } +} diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/RMv21CapabilityPatch.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/RMv21CapabilityPatch.java index f1875fd273..94d01534cf 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/RMv21CapabilityPatch.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/RMv21CapabilityPatch.java @@ -20,156 +20,75 @@ package org.alfresco.module.org_alfresco_module_rm.patch; import java.util.Set; -import org.alfresco.error.AlfrescoRuntimeException; -import org.alfresco.module.org_alfresco_module_rm.capability.Capability; -import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; -import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model; -import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; -import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel; import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService; -import org.alfresco.module.org_alfresco_module_rm.role.Role; import org.alfresco.service.cmr.repository.NodeRef; -import org.springframework.beans.factory.BeanNameAware; /** * RM v2.1 patch to updated modified capabilities. - * + * * @author Roy Wetherall * @since 2.1 */ -public class RMv21CapabilityPatch extends ModulePatchComponent - implements BeanNameAware, RecordsManagementModel, DOD5015Model -{ - /** file plan service */ - private FilePlanService filePlanService; - - /** File plan role service */ - private FilePlanRoleService filePlanRoleService; - - /** Capability service */ - private CapabilityService capabilityService; - - /** - * @param filePlanService file plan service - */ - public void setFilePlanService(FilePlanService filePlanService) - { - this.filePlanService = filePlanService; - } - - /** - * @param filePlanRoleService file plan role service - */ - public void setFilePlanRoleService(FilePlanRoleService filePlanRoleService) - { - this.filePlanRoleService = filePlanRoleService; - } - - /** - * @param capabilityService capability service - */ - public void setCapabilityService(CapabilityService capabilityService) - { - this.capabilityService = capabilityService; - } - +public class RMv21CapabilityPatch extends BaseRMCapabilityPatch +{ /** * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() */ @Override protected void executePatch() throws Throwable { - Set filePlans = filePlanService.getFilePlans(); - + Set filePlans = getFilePlans(); + if (logger.isDebugEnabled() == true) { logger.debug(" ... updating " + filePlans.size() + " file plans"); } - + for (NodeRef filePlan : filePlans) { if (logger.isDebugEnabled() == true) { logger.debug(" ... updating file plan " + filePlan.toString()); } - + // add new capabilities - addCapability(filePlan, - "CreateRecords", - FilePlanRoleService.ROLE_ADMIN, - FilePlanRoleService.ROLE_POWER_USER, + addCapability(filePlan, + "CreateRecords", + FilePlanRoleService.ROLE_ADMIN, + FilePlanRoleService.ROLE_POWER_USER, FilePlanRoleService.ROLE_RECORDS_MANAGER, FilePlanRoleService.ROLE_SECURITY_OFFICER); addCapability(filePlan, "ManageRules", FilePlanRoleService.ROLE_ADMIN); addCapability(filePlan, - "RequestRecordInformation", - FilePlanRoleService.ROLE_ADMIN, - FilePlanRoleService.ROLE_POWER_USER, + "RequestRecordInformation", + FilePlanRoleService.ROLE_ADMIN, + FilePlanRoleService.ROLE_POWER_USER, FilePlanRoleService.ROLE_RECORDS_MANAGER, - FilePlanRoleService.ROLE_SECURITY_OFFICER); + FilePlanRoleService.ROLE_SECURITY_OFFICER); addCapability(filePlan, - "FileDestructionReport", - FilePlanRoleService.ROLE_ADMIN, - FilePlanRoleService.ROLE_RECORDS_MANAGER); + "FileDestructionReport", + FilePlanRoleService.ROLE_ADMIN, + FilePlanRoleService.ROLE_RECORDS_MANAGER); addCapability(filePlan, - "RejectRecords", - FilePlanRoleService.ROLE_ADMIN, - FilePlanRoleService.ROLE_POWER_USER, + "RejectRecords", + FilePlanRoleService.ROLE_ADMIN, + FilePlanRoleService.ROLE_POWER_USER, FilePlanRoleService.ROLE_RECORDS_MANAGER, - FilePlanRoleService.ROLE_SECURITY_OFFICER); + FilePlanRoleService.ROLE_SECURITY_OFFICER); addCapability(filePlan, - "FileUnfiledRecords", - FilePlanRoleService.ROLE_ADMIN, - FilePlanRoleService.ROLE_POWER_USER, + "FileUnfiledRecords", + FilePlanRoleService.ROLE_ADMIN, + FilePlanRoleService.ROLE_POWER_USER, FilePlanRoleService.ROLE_RECORDS_MANAGER, - FilePlanRoleService.ROLE_SECURITY_OFFICER); + FilePlanRoleService.ROLE_SECURITY_OFFICER); addCapability(filePlan, - "LinkToRecords", - FilePlanRoleService.ROLE_ADMIN, - FilePlanRoleService.ROLE_POWER_USER, + "LinkToRecords", + FilePlanRoleService.ROLE_ADMIN, + FilePlanRoleService.ROLE_POWER_USER, FilePlanRoleService.ROLE_RECORDS_MANAGER, - FilePlanRoleService.ROLE_SECURITY_OFFICER); -} - } - - /** - * Adds a new capability to the specified roles. - * - * @param filePlan file plan - * @param capabilityName capability name - * @param roles roles - */ - private void addCapability(NodeRef filePlan, String capabilityName, String ... roles) - { - Capability capability = capabilityService.getCapability(capabilityName); - if (capability == null) - { - throw new AlfrescoRuntimeException("Unable to bootstrap RMv21 capabilities, because capability " + capabilityName + " does not exist."); + FilePlanRoleService.ROLE_SECURITY_OFFICER); } - - for (String roleName : roles) - { - Role role = filePlanRoleService.getRole(filePlan, roleName); - - if (role != null) - { - // get the roles current capabilities - Set capabilities = role.getCapabilities(); - - // only update if the capability is missing - if (capabilities.contains(capability) == false) - { - if (logger.isDebugEnabled() == true) - { - logger.debug(" ... adding capability " + capabilityName + " to role " + role.getName()); - } - - capabilities.add(capability); - filePlanRoleService.updateRole(filePlan, role.getName(), role.getDisplayLabel(), capabilities); - } - } - } - } + } } diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/RMv22CapabilityPatch.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/RMv22CapabilityPatch.java new file mode 100644 index 0000000000..b3316e92c1 --- /dev/null +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/patch/RMv22CapabilityPatch.java @@ -0,0 +1,61 @@ +/* + * 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.patch; + +import java.util.Set; + +import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService; +import org.alfresco.service.cmr.repository.NodeRef; + +/** + * RM v2.2 patch to updated modified capabilities. + * + * @author Tuna Aksoy + * @since 2.2 + */ +public class RMv22CapabilityPatch extends BaseRMCapabilityPatch +{ + /** + * @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal() + */ + @Override + protected void executePatch() throws Throwable + { + Set filePlans = getFilePlans(); + + if (logger.isDebugEnabled() == true) + { + logger.debug(" ... updating " + filePlans.size() + " file plans"); + } + + for (NodeRef filePlan : filePlans) + { + if (logger.isDebugEnabled() == true) + { + logger.debug(" ... updating file plan " + filePlan.toString()); + } + + // add new capability + addCapability(filePlan, + "FileDestructionReport", + FilePlanRoleService.ROLE_ADMIN, + FilePlanRoleService.ROLE_RECORDS_MANAGER); + } + } +}