[MRM-1765] #users > edit -- please sort effective roles

git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1545917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-11-27 03:42:00 +00:00
parent 483019e90e
commit ddc1d53a74
1 changed files with 15 additions and 0 deletions

View File

@ -54,6 +54,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@ -261,6 +262,9 @@ public class DefaultRoleManagementService
{
effectivelyAssignedRoles.add( new Role( r ) );
}
Collections.sort( effectivelyAssignedRoles, RoleComparator.INSTANCE );
return effectivelyAssignedRoles;
}
catch ( RbacManagerException rme )
@ -270,6 +274,17 @@ public class DefaultRoleManagementService
return new ArrayList<Role>( 0 );
}
private static class RoleComparator implements Comparator<Role> {
private static RoleComparator INSTANCE = new RoleComparator();
@Override
public int compare( Role role, Role role2 )
{
return role.getName().compareTo( role2.getName() );
}
}
public List<Application> getApplications( String username )
throws RedbackServiceException