This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Creating users and controlling access based upon roles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Creating users and controlling access based upon roles" Watch "Creating users and controlling access based upon roles" New topic
Author

Creating users and controlling access based upon roles

Praveen Kumar Singh
Greenhorn

Joined: Oct 05, 2009
Posts: 18

hi,

i am creating a page where i need to give user access to some pages on the basic of his role.

this page can be common for all user or may be there will be different pages on the basic of his role.

Please help me on this & tell me how can i do this.

Praveen Kumar Singh


PKS
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

Praveen Kumar Singh wrote:hi,

i am creating a page where i need to give user access to some pages on the basic of his role.

this page can be common for all user or may be there will be different pages on the basic of his role.

Please help me on this & tell me how can i do this.

Praveen Kumar Singh


One approach which immediately came to my mind:
You can have "Roles" associated with each user. You could store the User details in a Session and based on the User's role- You can give access to the page the user is eligible to view.
That way In the same page you could give access to different controls based on the User's role- Like the Moderation of Forum posts.

Am not aware of other ways, other members will be able to add more to this.

Mohamed Sanaulla | My Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Creating users and controlling access based upon roles
 
Similar Threads
how to bypass j2ee security roles
Redirect to the requested page failed using form-based authentication
Can I have j_security_check in two login.jsp
Using Realms for access controll with multiple roles
access control with realm db