You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by md...@apache.org on 2013/01/15 13:47:39 UTC

svn commit: r1433381 - in /syncope/trunk: ./ core/src/main/java/org/apache/syncope/core/connid/ConnObjectUtil.java

Author: mdisabatino
Date: Tue Jan 15 12:47:39 2013
New Revision: 1433381

URL: http://svn.apache.org/viewvc?rev=1433381&view=rev
Log:
SYNCOPE-274 Merge from 1_0_X

Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/core/src/main/java/org/apache/syncope/core/connid/ConnObjectUtil.java

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_0_X:r1432097-1433365

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/connid/ConnObjectUtil.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/connid/ConnObjectUtil.java?rev=1433381&r1=1433380&r2=1433381&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/connid/ConnObjectUtil.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/connid/ConnObjectUtil.java Tue Jan 15 12:47:39 2013
@@ -41,6 +41,7 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.persistence.beans.AbstractVirAttr;
 import org.apache.syncope.core.persistence.beans.ExternalResource;
 import org.apache.syncope.core.persistence.beans.SyncTask;
+import org.apache.syncope.core.persistence.beans.membership.Membership;
 import org.apache.syncope.core.persistence.beans.role.SyncopeRole;
 import org.apache.syncope.core.persistence.beans.user.SyncopeUser;
 import org.apache.syncope.core.persistence.dao.PolicyDAO;
@@ -202,6 +203,13 @@ public class ConnObjectUtil {
                 ((UserTO) updated).setPassword(null);
             }
 
+            for (MembershipTO membTO : ((UserTO) updated).getMemberships()) {
+                Membership memb = user.getMembership(membTO.getRoleId());
+                if (memb != null) {
+                    membTO.setId(memb.getId());
+                }
+            }
+
             return (T) AttributableOperations.diff(((UserTO) updated), ((UserTO) original), true);
         }
         if (AttributableType.ROLE == attrUtil.getType()) {