RM-1430 - Fixed move to holds/unfiled/transfers issues along with associated tests

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@66928 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Hibbins
2014-04-07 15:18:55 +00:00
parent 856ce177d7
commit 1f39466252
3 changed files with 16 additions and 10 deletions

View File

@@ -869,7 +869,7 @@
<bean id="copyTo_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity"> <bean id="copyTo_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
<property name="objectDefinitionSource"> <property name="objectDefinitionSource">
<value> <value>
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.CreateModifyDestroyEvents org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.rmCopy
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
</value> </value>
@@ -897,7 +897,7 @@
<bean id="moveTo_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity"> <bean id="moveTo_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor" parent="actionSecurity">
<property name="objectDefinitionSource"> <property name="objectDefinitionSource">
<value> <value>
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.CreateModifyDestroyEvents org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.execute=RM_CAP.0.rma:filePlanComponent.rmMove
org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW org.alfresco.module.org_alfresco_module_rm.action.RecordsManagementAction.*=RM_ALLOW
org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW org.alfresco.repo.action.executer.ActionExecuter.*=RM_ALLOW
</value> </value>

View File

@@ -209,6 +209,16 @@ public abstract class CopyMoveFileToBaseAction extends RMActionExecuterAbstractB
throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the destination path could not be determined."); throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the destination path could not be determined.");
} }
} }
else
{
QName nodeType = nodeService.getType(nodeRef);
if(nodeType.equals(RecordsManagementModel.TYPE_HOLD_CONTAINER) ||
nodeType.equals(RecordsManagementModel.TYPE_TRANSFER_CONTAINER) ||
nodeType.equals(RecordsManagementModel.TYPE_UNFILED_RECORD_CONTAINER))
{
throw new AlfrescoRuntimeException("Unable to execute " + action.getActionDefinitionName() + " action, because the destination path in invalid.");
}
}
if(pathElements.size() > 1) if(pathElements.size() > 1)
{ {
nodeRef = createOrResolvePath(action, nodeRef, actionedUponNodeRef, pathElements.subList(1, pathElements.size()), targetisUnfiledRecords, create, creating); nodeRef = createOrResolvePath(action, nodeRef, actionedUponNodeRef, pathElements.subList(1, pathElements.size()), targetisUnfiledRecords, create, creating);

View File

@@ -27,6 +27,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.capability.Capability; 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.capability.CapabilityService;
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.repo.action.parameter.ParameterProcessorComponent; import org.alfresco.repo.action.parameter.ParameterProcessorComponent;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
@@ -56,10 +57,6 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
private final static String SUBSTITUTIONS_MODEL_KEY = "substitutions"; private final static String SUBSTITUTIONS_MODEL_KEY = "substitutions";
private final static String RECORD_FOLDER_TYPE = "recordFolder";
private final static String RECORD_CATEGORY_TYPE = "recordCategory";
private final static String UNFILED_RECORD_FOLDER_TYPE = "unfiledRecordContainerChild";
private final static String CREATE_CAPABILITY = "Create"; private final static String CREATE_CAPABILITY = "Create";
private final static String VIEW_CAPABILITY = "ViewRecords"; private final static String VIEW_CAPABILITY = "ViewRecords";
@@ -274,10 +271,9 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
{ {
// check node type // check node type
QName type = nodeService.getType(nodeRef); QName type = nodeService.getType(nodeRef);
String typeLocalName = type.getLocalName(); boolean isCorrectType = (!unfiled
boolean isCorrectType = && (RecordsManagementModel.TYPE_RECORD_FOLDER.equals(type) || RecordsManagementModel.TYPE_RECORD_CATEGORY
(!unfiled && (RECORD_FOLDER_TYPE.equals(typeLocalName) || RECORD_CATEGORY_TYPE.equals(typeLocalName)) || .equals(type)) || (unfiled && RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER.equals(type)));
(unfiled && UNFILED_RECORD_FOLDER_TYPE.equals(typeLocalName)));
// check permissions // check permissions
boolean canView = false; boolean canView = false;