Apr 24th, 2008, 03:02 PM
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?
Nov 6th, 2008, 08:02 AM
I'm looking into updating an app and ditching acegi for spring security and I'm facing the same problem.
Enum roles do fit like a glove.
Nov 21st, 2008, 08:54 AM
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.
Nov 21st, 2008, 10:37 AM
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