This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use isUserInRole

 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

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


Thanks
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what exactly is the problem.

Did you already authenticate you to the server as 'ResearchAdmin' ?
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. And added principals to it.

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic