• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

MultipleRoles with JDBCRealm

 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic