File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use isUserInRole

 
Justin Howard
Ranch Hand
Posts: 162
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. And added principals to it.

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • 0
  • 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
  • 0
  • 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: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic