Spring security with database and multiple roles?

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2010-04-25T08:58:50Z Indexed on 2010/04/25 9:03 UTC
Read the original article Hit count: 151

Filed under:

I'm trying to make an application using spring 3.0. Now I've decided to try my hand at spring-security and hibernate. I've already seen that it's possible to back it with a databasem and I've seen a reference to defining your own queries?

Now the problem I have is that the tutorials I've been finding aren't too clear and that they assume that a user can only have one role. I want to give some users multiple roles.

So I was thinking about a database scheme along the lines of:

User:

  • user_id
  • username
  • password
  • registrationDate

User_Role:

  • user_id
  • role_id

Role:

  • role_id
  • rolename

Now I was wondering if anyone had some pointers to some usefull tutorials/advice/comments.

© Stack Overflow or respective owner

Related posts about spring-security