Results 1 to 2 of 2

Thread: getAuthorities returns ordered collection

  1. #1
    Join Date
    Nov 2007
    Location
    Baltimore, MD
    Posts
    24

    Default getAuthorities returns ordered collection

    For writing custom implementation of UserDetails, why does the getAuthorities method require the collection to be returned to be sorted?

    the authorities, sorted by natural key (never null)
    Is it mandatory requirement or just good-to-have-for-performance kind of thing?

    If it is mandatory then why is it not dictated by the type of interface being used for the return type. Instead of Collection<GrantedAuthority> it could have been SortedSet<GrantedAuthority>.

    I searched a lot but most of the time i am getting results for older api which used to return the array.

    Thanks in advance

  2. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    No, it shouldn't matter. It was originally a requirement because of issue SEC-717.
    Spring - by Pivotal
    twitter @tekul

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •