Move description field
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / ldap / nature / SimpleUserNatureMapper.java
index 9cad98d68b13b9e3baf1da4a99f7be68f2fa0372..c9d1efd7a98c1ad038e2c13184d2af18bf50f98b 100644 (file)
@@ -13,6 +13,7 @@ public class SimpleUserNatureMapper implements UserNatureMapper {
                nature.setLastName(ctx.getStringAttribute("sn"));
                nature.setFirstName(ctx.getStringAttribute("givenName"));
                nature.setEmail(ctx.getStringAttribute("mail"));
+               nature.setDescription(ctx.getStringAttribute("description"));
                return nature;
        }
 
@@ -24,6 +25,9 @@ public class SimpleUserNatureMapper implements UserNatureMapper {
                ctx.setAttributeValue("sn", nature.getLastName());
                ctx.setAttributeValue("givenName", nature.getFirstName());
                ctx.setAttributeValue("mail", nature.getEmail());
+               if (nature.getDescription() != null) {
+                       ctx.setAttributeValue("description", nature.getDescription());
+               }
        }
 
        public Boolean supports(UserNature userNature) {