Merge remote-tracking branch 'remotes/origin/feature/RM-6904_PreventUpdateHeldActiveContent' into feature/RM-6914_AddRemoveToHold_Tests

This commit is contained in:
Rodica Sutu
2019-08-19 09:22:41 +03:00

View File

@@ -205,6 +205,8 @@ public class HoldServiceImpl extends ServiceBaseImpl
List<NodeRef> frozenNodes = getHeld(hold);
for (NodeRef frozenNode : frozenNodes)
{
//set in transaction cache in order not to trigger update policy when removing the child association
transactionalResourceHelper.getSet("frozen").add(frozenNode);
removeFreezeAspect(frozenNode, 1);
}
@@ -232,7 +234,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
{
// remove the freeze aspect from the node
//set in transaction cache in order not to trigger update policy when removing the aspect
transactionalResourceHelper.getSet(nodeRef).add("frozen");
transactionalResourceHelper.getSet("frozen").add(nodeRef);
nodeService.removeAspect(nodeRef, ASPECT_FROZEN);
}
@@ -248,7 +250,7 @@ public class HoldServiceImpl extends ServiceBaseImpl
{
// remove the freeze aspect from the node
//set in transaction cache in order not to trigger update policy when removing the aspect
transactionalResourceHelper.getSet(record).add("frozen");
transactionalResourceHelper.getSet("frozen").add(record);
nodeService.removeAspect(record, ASPECT_FROZEN);
}
}
@@ -730,19 +732,17 @@ public class HoldServiceImpl extends ServiceBaseImpl
// run as system so we don't run into further permission issues
// we already know we have to have the correct capability to get here
authenticationUtil.runAsSystem((RunAsWork<Void>) () -> {
{
// remove from hold
//set in transaction cache in order not to trigger update policy when removing the child association
transactionalResourceHelper.getSet("frozen").add(nodeRef);
nodeService.removeChild(hold, nodeRef);
// remove from hold
//set in transaction cache in order not to trigger update policy when removing the child association
transactionalResourceHelper.getSet(nodeRef).add("frozen");
nodeService.removeChild(hold, nodeRef);
// audit that the node has been remove from the hold
// TODO add details of the hold that the node was removed from
recordsManagementAuditService.auditEvent(nodeRef, AUDIT_REMOVE_FROM_HOLD);
// audit that the node has been remove from the hold
// TODO add details of the hold that the node was removed from
recordsManagementAuditService.auditEvent(nodeRef, AUDIT_REMOVE_FROM_HOLD);
return null;
return null;
}
});
}
}