RM-942: It's possible to move/copy/link to/from and delete from closed folder

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@56073 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-09-27 08:21:32 +00:00
parent 5e8ffa4634
commit 8c96aad8f0
3 changed files with 16 additions and 4 deletions

View File

@@ -363,7 +363,7 @@ public class RecordServiceImpl implements RecordService,
policyComponent.bindClassBehaviour(
NodeServicePolicies.OnRemoveAspectPolicy.QNAME,
ContentModel.ASPECT_NO_CONTENT,
new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.TRANSACTION_COMMIT));
new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.EVERY_EVENT));
}
/**

View File

@@ -111,10 +111,21 @@ public class RecordFolderServiceImpl extends ServiceBaseImpl
public void onCreateChildAssociationInRecordFolder(ChildAssociationRef childAssocRef, boolean bNew)
{
NodeRef nodeRef = childAssocRef.getChildRef();
if (nodeService.exists(nodeRef) == true &&
instanceOf(nodeRef, ContentModel.TYPE_FOLDER) == true)
if (nodeService.exists(nodeRef) == true)
{
throw new AlfrescoRuntimeException("You can't create a folder within an exisiting record folder.");
// ensure folders are never added to a record folder
if (instanceOf(nodeRef, ContentModel.TYPE_FOLDER) == true)
{
throw new AlfrescoRuntimeException("You can't create a folder within an exisiting record folder.");
}
// ensure nothing is being added to a closed record folder
NodeRef recordFolder = childAssocRef.getParentRef();
Boolean isClosed = (Boolean) this.nodeService.getProperty(recordFolder, PROP_IS_CLOSED);
if (isClosed != null && Boolean.TRUE.equals(isClosed) == true)
{
throw new AlfrescoRuntimeException("You can't add new items to a closed record folder.");
}
}
}