mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
[RM-878] Deleting folder with declared records does not remove groups from the extended groups properties. Add new behaviour to look for child associations where the node is not primary, has the rma:recordOriginatingDetails aspect and where the deleted parent is a folder. If all matches, then remove the extended security properties from the "primary" child node.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@55000 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -198,6 +198,10 @@ public class RecordServiceImpl implements RecordService,
|
||||
this,
|
||||
"onUpdateProperties",
|
||||
NotificationFrequency.EVERY_EVENT);
|
||||
private JavaBehaviour onDeleteDeclaredRecordLink = new JavaBehaviour(
|
||||
this,
|
||||
"onDeleteDeclaredRecordLink",
|
||||
NotificationFrequency.FIRST_EVENT);
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
|
||||
@@ -339,6 +343,11 @@ public class RecordServiceImpl implements RecordService,
|
||||
NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
|
||||
ASPECT_RECORD,
|
||||
onUpdateProperties);
|
||||
policyComponent.bindAssociationBehaviour(
|
||||
NodeServicePolicies.BeforeDeleteChildAssociationPolicy.QNAME,
|
||||
ContentModel.TYPE_FOLDER,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
onDeleteDeclaredRecordLink);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -428,7 +437,28 @@ public class RecordServiceImpl implements RecordService,
|
||||
{
|
||||
onUpdateProperties.enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Looking specifically at linked content that was declared a record from a non-rm site.
|
||||
* When the site or the folder that the link was declared in is deleted we need to remove
|
||||
* the extended security property accounts in the tree
|
||||
*
|
||||
* @param childAssocRef
|
||||
*/
|
||||
public void onDeleteDeclaredRecordLink(ChildAssociationRef childAssocRef)
|
||||
{
|
||||
// Is the deleted child association not a primary association?
|
||||
// Does the deleted child association have the rma:recordOriginatingDetails aspect?
|
||||
// Is the parent of the deleted child association a folder (cm:folder)?
|
||||
if (!childAssocRef.isPrimary() &&
|
||||
nodeService.hasAspect(childAssocRef.getChildRef(), ASPECT_RECORD_ORIGINATING_DETAILS) &&
|
||||
nodeService.getType(childAssocRef.getParentRef()).equals(ContentModel.TYPE_FOLDER))
|
||||
{
|
||||
// ..then remove the extended readers and writers up the tree for this remaining node
|
||||
extendedSecurityService.removeExtendedSecurity(childAssocRef.getChildRef(), extendedSecurityService.getExtendedReaders(childAssocRef.getChildRef()), extendedSecurityService.getExtendedWriters(childAssocRef.getChildRef()), true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.record.RecordService#disablePropertyEditableCheck()
|
||||
|
Reference in New Issue
Block a user