-
1. Re: Using Roles without creating entities in the DB
erich Aug 17, 2009 2:15 AM (in response to erich)I looked around some more. The difficulty right now is there's no mapping for an EnumSet within the JPA. Hibernate itself also does not have a built-in way to map an EnumSet, although there are some ways to do do it using a custom type.
I guess what I am hoping for won't be possible unless / until EnumSet is supported by the JPA. I hope that will happen because it's a very good fit for the typical kind of usage, and provides type safety.
-
2. Re: Using Roles without creating entities in the DB
shane.bryzak Aug 17, 2009 2:16 AM (in response to erich)You don't need to use JPA. Simply create your own IdentityStore implementation that uses an enum for roles, and set IdentityManager.roleIdentityStore to this new IdentityStore.
-
3. Re: Using Roles without creating entities in the DB
erich Aug 17, 2009 2:23 AM (in response to erich)Ok, cool, I'll try that out!
Much rather not have my roles in the DB. Avoiding it gives me better type checking, less initialization code, etc.
-
4. Re: Using Roles without creating entities in the DB
erich Aug 17, 2009 2:32 AM (in response to erich)I'm just now looking at that. It looks simple! I may do an article about building a simple typesafe authorization system using that. Very cool stuff!
-
5. Re: Using Roles without creating entities in the DB
zgood Feb 8, 2011 3:26 AM (in response to erich)Hi Eric H! Can you share your solution? It would help to many people.