Announcement Announcement Module
No announcement yet.
2.0 GrantedAuthority cannot be an enum Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 2.0 GrantedAuthority cannot be an enum

    I was upgrading to spring-security today from acegi. I usually store my GrantedAuthorities as Java 5 enums, to me this is perfect use case for enum.

    It seems in spring-security I cannot do this though I get the compile error.

    The interface Comparable cannot be implemented more than once with different arguments: Comparable<ApplicationPermission> and Comparable.

    Since ApplicationPermission is an enum and base class of enum implements the generic Comparable, and GrantedAuthority now implements Object Comparable.

    Does anybody know a workaround for this?

  • #2
    I'm looking into updating an app and ditching acegi for spring security and I'm facing the same problem.

    Any suggestions?

    Enum roles do fit like a glove.


    • #3

      I'm facing the same problem as well. Is there any fix or workaround for this ? I'm testing the migration to Spring Security 2 on a smaller app before I do it for our company's major systems.


      • #4
        Hey guys,

        I've written an acceptable (at least for myself) workaround and posted it on my blog if you're interested. It took all of 90 minutes to research, write, test and post :

        On Hibernate UserTypes