mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V21 to HEAD:
62861: RM-1261: Records/Folders scheduled for destruction can be deleted by user without required capabilities RM-1258: It's possible to edit, delete and create (via copy) new category without "Create Modify Destroy File Plan Metadata" capability 62862: RM-1267: Delete Record capability is needed to delete the reference git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@62863 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1149,7 +1149,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService#removeCustomReference(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public void removeCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId)
|
||||
public void removeCustomReference(final NodeRef fromNode, final NodeRef toNode, final QName assocId)
|
||||
{
|
||||
Map<QName, AssociationDefinition> availableAssocs = this.getCustomReferenceDefinitions();
|
||||
|
||||
@@ -1166,14 +1166,23 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
|
||||
// TODO: Ask for a more efficient method such as
|
||||
// nodeService.removeChildAssociation(fromNode, toNode, chRef.getTypeQName(), null);
|
||||
|
||||
List<ChildAssociationRef> children = nodeService.getChildAssocs(fromNode);
|
||||
for (ChildAssociationRef chRef : children)
|
||||
{
|
||||
if (assocId.equals(chRef.getTypeQName()) && chRef.getChildRef().equals(toNode))
|
||||
{
|
||||
nodeService.removeChildAssociation(chRef);
|
||||
}
|
||||
}
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
List<ChildAssociationRef> children = nodeService.getChildAssocs(fromNode);
|
||||
for (ChildAssociationRef chRef : children)
|
||||
{
|
||||
if (assocId.equals(chRef.getTypeQName()) && chRef.getChildRef().equals(toNode))
|
||||
{
|
||||
nodeService.removeChildAssociation(chRef);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user