mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user