Skip to content

Commit

Permalink
Fixing MID-2368 (associationFromLink seems not to remove account from…
Browse files Browse the repository at this point in the history
… entitlement when role is unassigned) and MID-2418 (Unassigning role will not remove account from group).
  • Loading branch information
mederly committed Jun 23, 2015
1 parent e21a2c8 commit 0c41c1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Expand Up @@ -376,7 +376,8 @@ public void visit(I pvwo) {
continue;
}
if (filterExistingValues && !hasValue(itemExisting, value, valueMatcher, comparator)) {
LOGGER.trace("Value {} NOT deleted to delta for item {} the item does not have that value in {}",
// temporarily changed from .trace to .info in order to assist with problems like MID-2368
LOGGER.info("Value {} NOT deleted to delta for item {} the item does not have that value in {}",
new Object[]{value, itemPath, contextDescription});
continue;
}
Expand Down
Expand Up @@ -76,7 +76,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowAssociationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;

import org.apache.commons.lang.Validate;
import org.apache.commons.lang.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -331,8 +331,13 @@ public int compare(PrismContainerValue<ShadowAssociationType> o1,

PrismReference ref1 = o1.findReference(ShadowAssociationType.F_SHADOW_REF);
PrismReference ref2 = o2.findReference(ShadowAssociationType.F_SHADOW_REF);

if (ref1.equals(ref2)){

// We do not want to compare references in details. Comparing OIDs suffices.
// Otherwise we get into problems, as one of the references might be e.g. without type,
// causing unpredictable behavior (MID-2368)
String oid1 = ref1 != null ? ref1.getOid() : null;
String oid2 = ref2 != null ? ref2.getOid() : null;
if (ObjectUtils.equals(oid1, oid2)) {
return 0;
}

Expand Down

0 comments on commit 0c41c1b

Please sign in to comment.