• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

MultipleRoles with JDBCRealm

 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm setting up a webapp and am using JDBCRealm for authentication and security. How would I represent multiple roles in the user roles table?

Any help will be endlessly appreciated,
Thank you!
-D.P.
[ November 12, 2005: Message edited by: Daniel Prene ]
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume that you are familiar with the documentation. There can be any number of user/role combinations. What precisely is the problem you're facing?
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The user roles table must contain at least two columns (it may contain more if your existing applications required it):

* Username to be recognized by Tomcat (same value as is specified in the users table).
* Role name of a valid role associated with this user.
[/quote

what about in instances where there are more then one? Anyone have an example of this?

 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I must be missing somthing obvious. I don't usualy beg for help, but could some one PLEASE just show me what a table supporting mutliple rows would look like?
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The example in the documentation shows how the tables might be created. (Personally, I would add a third table listing the roles, add IDs to all three of them, and establish foreign key relationships, but that's besides the point.) Do you have problems inserting values into the tables? There's nothing unusual about having records ("daniel", "admin") and ("daniel", "user") and ("peter", "user") in the user_roles table.
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!