Author: bdaw
Date: 2010-11-10 04:14:49 -0500 (Wed, 10 Nov 2010)
New Revision: 548
Modified:
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java
Log:
- fix usage of "childMembershipAttributeVirtual" LDAP config option
Modified:
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java 2010-11-09
16:44:46 UTC (rev 547)
+++
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java 2010-11-10
09:14:49 UTC (rev 548)
@@ -903,7 +903,18 @@
defaultIdentityStore.createIdentityObject(defaultTargetCtx,
toIdentity.getName(), toIdentity.getIdentityType());
}
- defaultIdentityStore.removeRelationship(defaultTargetCtx, fromIdentity,
toIdentity, relationshipType, relationshipName);
+ Set<IdentityObjectRelationship> rels =
+ defaultIdentityStore.resolveRelationships(defaultTargetCtx,
fromIdentity, toIdentity, relationshipType);
+
+ for (IdentityObjectRelationship rel : rels) {
+
+ if (rel.getName() == null || rel.getName().equals(relationshipName))
+ {
+ defaultIdentityStore.
+ removeRelationship(defaultTargetCtx, fromIdentity, toIdentity,
relationshipType, relationshipName);
+ }
+ }
+
}
catch (IdentityException e)
{
Modified:
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-11-09
16:44:46 UTC (rev 547)
+++
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2010-11-10
09:14:49 UTC (rev 548)
@@ -1941,12 +1941,15 @@
try
{
// Escape JNDI special characters
- Name jndiName = new CompositeName().add(ldapFromIO.getDn());
- Attributes attrs = ldapContext.getAttributes(jndiName);
+ Name fromJndiName = new CompositeName().add(ldapFromIO.getDn());
+ Attributes fromAttrs = ldapContext.getAttributes(fromJndiName);
+ Name toJndiName = new CompositeName().add(ldapToIO.getDn());
+ Attributes toAttrs = ldapContext.getAttributes(toJndiName);
+
if (fromTypeConfig.getParentMembershipAttributeName() != null)
{
- Attribute member =
attrs.get(fromTypeConfig.getParentMembershipAttributeName());
+ Attribute member =
fromAttrs.get(fromTypeConfig.getParentMembershipAttributeName());
if (member != null)
{
@@ -1966,7 +1969,7 @@
}
else if (toTypeConfig.getChildMembershipAttributeName() != null)
{
- Attribute member =
attrs.get(toTypeConfig.getChildMembershipAttributeName());
+ Attribute member =
toAttrs.get(toTypeConfig.getChildMembershipAttributeName());
if (member != null)
{
@@ -1975,8 +1978,8 @@
{
String memberRef = memberValues.nextElement().toString();
- if ((fromTypeConfig.isChildMembershipAttributeDN() &&
memberRef.equals(ldapFromIO.getDn())) ||
- (!fromTypeConfig.isChildMembershipAttributeDN() &&
memberRef.equals(ldapFromIO.getName())))
+ if ((toTypeConfig.isChildMembershipAttributeDN() &&
memberRef.equals(ldapFromIO.getDn())) ||
+ (!toTypeConfig.isChildMembershipAttributeDN() &&
memberRef.equals(ldapFromIO.getName())))
{
//TODO: impl lacks support for rel type
relationships.add(new
LDAPIdentityObjectRelationshipImpl(MEMBERSHIP_TYPE, ldapFromIO, ldapToIO));
Modified:
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java 2010-11-09
16:44:46 UTC (rev 547)
+++
idm/branches/1.1.0/picketlink-idm-ldap/src/main/java/org/picketlink/idm/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java 2010-11-10
09:14:49 UTC (rev 548)
@@ -177,7 +177,7 @@
this.isChildMembershipAttributeDN = false;
}
- String isChildMembershipAttributeVirtual =
objectTypeMD.getOptionSingleValue(CHILD_MEMBERSHIP_ATTRIBUTE_DN);
+ String isChildMembershipAttributeVirtual =
objectTypeMD.getOptionSingleValue(CHILD_MEMBERSHIP_ATTRIBUTE_VIRTUAL);
if (isChildMembershipAttributeVirtual != null &&
isChildMembershipAttributeVirtual.equalsIgnoreCase("false"))
{
this.isChildMembershipAttributeVirtual = false;
Show replies by date