diff --git a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java index 3c5f9501..31197c0e 100644 --- a/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java +++ b/redback-integrations/redback-rest/redback-rest-services/src/main/java/org/apache/archiva/redback/rest/services/DefaultRoleManagementService.java @@ -631,7 +631,11 @@ public class DefaultRoleManagementService Collection appRoles = filterApplicationRoles( modelApplication, allRoles, modelApplication.getTemplates() ); - applicationRoles.setGlobalRoles( toRoleNames( appRoles ) ); + List roleNames = new ArrayList( toRoleNames( appRoles ) ); + + Collections.sort( roleNames ); + + applicationRoles.setGlobalRoles( roleNames ); Set resources = discoverResources( modelApplication.getTemplates(), appRoles ); @@ -651,8 +655,12 @@ public class DefaultRoleManagementService } } + Collections.sort( appRoleNames ); + applicationRoles.setGlobalRoles( appRoleNames ); + Collections.sort( appRoleNames ); + applicationRolesList.add( applicationRoles ); }