Improve user admin configuration
[lgpl/argeo-commons.git] / org.argeo.security.core / src / org / argeo / osgi / useradmin / LdifAuthorization.java
index 845fefd13da483a6ee88c3c48690c0f45062ad0d..3a2aeca2ea5c2715a58ee84815d82b700b82819f 100644 (file)
@@ -9,7 +9,7 @@ import org.osgi.service.useradmin.Authorization;
 import org.osgi.service.useradmin.Role;
 import org.osgi.service.useradmin.User;
 
-public class LdifAuthorization implements Authorization, LdapNames {
+public class LdifAuthorization implements Authorization {
        private final String name;
        private final String displayName;
        private final List<String> allRoles;
@@ -21,16 +21,16 @@ public class LdifAuthorization implements Authorization, LdapNames {
                } else {
                        this.name = user.getName();
                        Dictionary<String, Object> props = user.getProperties();
-                       Object displayName = props.get(LDAP_DISPLAY_NAME);
+                       Object displayName = props.get(LdifName.displayName);
                        if (displayName == null)
-                               displayName = props.get(LDAP_CN);
+                               displayName = props.get(LdifName.cn);
                        if (displayName == null)
-                               displayName = props.get(LDAP_UID);
+                               displayName = props.get(LdifName.uid);
                        if (displayName == null)
                                displayName = user.getName();
                        if (displayName == null)
-                               throw new UserDirectoryException(
-                                               "Cannot set display name for " + user);
+                               throw new UserDirectoryException("Cannot set display name for "
+                                               + user);
                        this.displayName = displayName.toString();
                }
                // roles