Impl. Add/Remove to/from Context not following PropagationConstraints

This commit is contained in:
Luca Frosini 2021-01-26 17:04:00 +01:00
parent ab1f81fce7
commit 406035dd40
2 changed files with 8 additions and 2 deletions

View File

@ -202,9 +202,9 @@ public abstract class EntityManagement<E extends EntityElement> extends EntityEl
/*
* DO NOT UNCOMMENT
* // affectedInstances.put(uuid, serializeSelfOnly());
* the instance is added in internalAddToContext() function after
* the update of Header metadata i.e. modifiedBy, lastUpdateTime
* affectedInstances.put(uuid, serializeSelfOnly());
*/
Iterable<OEdge> edges = getElement().getEdges(ODirection.OUT);
@ -212,6 +212,7 @@ public abstract class EntityManagement<E extends EntityElement> extends EntityEl
for(OEdge edge : edges) {
RelationManagement<?> relationManagement = getRelationManagement(edge);
relationManagement.setDryRunContextSharing(dryRunContextSharing);
relationManagement.setHonourPropagationConstraintsInContextSharing(honourPropagationConstraintsInContextSharing);
affectedInstances.putAll(relationManagement.internalAddToContext(targetSecurityContext));
}
@ -229,6 +230,7 @@ public abstract class EntityManagement<E extends EntityElement> extends EntityEl
for(OEdge edge : edges) {
RelationManagement<?> relationManagement = getRelationManagement(edge);
relationManagement.setDryRunContextSharing(dryRunContextSharing);
relationManagement.setHonourPropagationConstraintsInContextSharing(honourPropagationConstraintsInContextSharing);
affectedInstances.putAll(relationManagement.internalRemoveFromContext(targetSecurityContext));
}

View File

@ -330,6 +330,7 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
*/
T targetEntityManagement = getTargetEntityManagement();
targetEntityManagement.setDryRunContextSharing(dryRunContextSharing);
targetEntityManagement.setHonourPropagationConstraintsInContextSharing(honourPropagationConstraintsInContextSharing);
affectedInstances.putAll(targetEntityManagement.internalAddToContext(targetSecurityContext));
if(!dryRunContextSharing) {
@ -337,9 +338,9 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
}
/*
* DO NOT UNCOMMENT
* // affectedInstances.put(uuid, serializeSelfOnly());
* the relation instance is added in internalAddToContext() function after
* the update of Header metadata i.e. modifiedBy, lastUpdateTime
* affectedInstances.put(uuid, serializeSelfOnly());
*/
break;
@ -363,11 +364,13 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
/* Adding source to Context */
ResourceManagement resourceManagement = getSourceEntityManagement();
resourceManagement.setDryRunContextSharing(dryRunContextSharing);
resourceManagement.setHonourPropagationConstraintsInContextSharing(honourPropagationConstraintsInContextSharing);
affectedInstances.putAll(resourceManagement.internalAddToContext(targetSecurityContext));
/* Adding target to Context */
T targetEntityManagement = getTargetEntityManagement();
targetEntityManagement.setDryRunContextSharing(dryRunContextSharing);
targetEntityManagement.setHonourPropagationConstraintsInContextSharing(honourPropagationConstraintsInContextSharing);
affectedInstances.putAll(getTargetEntityManagement().internalAddToContext(targetSecurityContext));
if(!dryRunContextSharing) {
@ -419,6 +422,7 @@ public abstract class RelationManagement<T extends EntityManagement<? extends En
T targetEntityManagement = getTargetEntityManagement();
targetEntityManagement.setDryRunContextSharing(dryRunContextSharing);
targetEntityManagement.setHonourPropagationConstraintsInContextSharing(honourPropagationConstraintsInContextSharing);
switch(removeConstraint) {
case cascade: