Skip to content

Commit

Permalink
sorted auth groups list by label as default (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioG70 authored Dec 2, 2024
1 parent 939536f commit 08af643
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -77,6 +80,8 @@ public Set<AuthorizationGroup> getAuthorizationGroupsList() {
AuthorizationGroupsList authorizationGroupsList = ViewerConfiguration.getInstance()
.getCollectionsAuthorizationGroupsWithDefault();

return authorizationGroupsList.getAuthorizationGroupsList();
return authorizationGroupsList.getAuthorizationGroupsList().stream()
.sorted(Comparator.comparing(AuthorizationGroup::getLabel, String.CASE_INSENSITIVE_ORDER))
.collect(Collectors.toCollection(LinkedHashSet::new));
}
}

0 comments on commit 08af643

Please sign in to comment.