import java.util.Enumeration;
import java.util.Hashtable;
import java.util.List;
+import java.util.Locale;
import java.util.Optional;
import java.util.StringJoiner;
} else {
// user doesn't have the right to retrieve role, but we know it exists
// otherwise memberOf would not work
-// Attributes a = new BasicAttributes();
-// a.put(LdapNameUtils.getLastRdn(groupDn).getType(),
-// LdapNameUtils.getLastRdn(groupDn).getValue());
-// a.put(LdapAttrs.objectClass.name(), LdapObjs.groupOfNames.name());
group = newGroup(groupDn);
allRoles.add(group);
}
return getName();
}
+ @Override
+ public String getHierarchyUnitLabel(Locale locale) {
+ String key = LdapNameUtils.getLastRdn(getBaseDn()).getType();
+ Object value = LdapEntry.getLocalized(asLdapEntry().getProperties(), key, locale);
+ if (value == null)
+ value = getHierarchyUnitName();
+ assert value != null;
+ return value.toString();
+ }
+
@Override
public HierarchyUnit getParent() {
return null;
}
return name;
} catch (InvalidNameException e) {
- throw new IllegalStateException("Cannot get role " + path, e);
+ throw new IllegalStateException("Cannot convert " + path + " to LDAP name", e);
}
}