Author: bdaw
Date: 2010-02-23 04:42:10 -0500 (Tue, 23 Feb 2010)
New Revision: 1815
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
Log:
- GTNPORTAL-617 - memberships management issue
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
---
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2010-02-23
09:40:49 UTC (rev 1814)
+++
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2010-02-23
09:42:10 UTC (rev 1815)
@@ -232,8 +232,21 @@
}
- if (!hasRole)
+ boolean associated = false;
+
+ try
{
+ associated =
getIdentitySession().getRelationshipManager().isAssociatedByKeys(groupId,
m.getUserName());
+ }
+ catch (Exception e)
+ {
+ //TODO:
+ log.info("Identity operation error: ", e);
+ }
+
+ if (!hasRole &&
+ !(isAssociationMapped() &&
getAssociationMapping().equals(m.getMembershipType()) && associated))
+ {
return m;
}
@@ -257,19 +270,6 @@
}
}
- boolean associated = false;
-
- try
- {
- associated =
getIdentitySession().getRelationshipManager().isAssociatedByKeys(m.getGroupId(),
m.getUserName());
- }
- catch (Exception e)
- {
- //TODO:
- log.info("Identity operation error: ", e);
-
- }
-
if (isAssociationMapped() &&
getAssociationMapping().equals(m.getMembershipType()) && associated)
{
Set<String> keys = new HashSet<String>();