Two Laptop Bag*
The moose likes Servlets and the fly likes How to use isUserInRole Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to use isUserInRole" Watch "How to use isUserInRole" New topic
Author

How to use isUserInRole

Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Hi All,

I am trying to make this work in the app with no favourable results.


Thanks
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Well, what exactly is the problem.

Did you already authenticate you to the server as 'ResearchAdmin' ?


JDBCSupport - An easy to use, light-weight JDBC framework -
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Yes. And added principals to it.

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
The Role Users are maintained by the container. The default implementation is defining the users with passwords in the tomcat-users.xml and web.xml, the rest is taken care of by the container.
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Thank you.

I have not maintained the users in the tomcat-user.xml. I have retained them in the database.
Does this mean I cannot use the function.
Is there a simple way to check if the person is tied to a role, or should I write a custom function checking the principals
if there is a particular principal added for a user. If I do so will it slow down the app?

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Justin Howard wrote:Does this mean I cannot use the function.

Of course not. How's it supposed to know anything about your database or data model?

Is there a simple way to check if the person is tied to a role, or should I write a custom function checking the principals

You'll need to write code that checks the roles according to the rules of your data model.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to use isUserInRole