|
|
|
|
![]() ![]() |
Feb 21 2005, 07:35 AM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 7 Joined: 21-February 05 Member No.: 3,887 |
Hi guys,
Do you have ideas on implementing role-based and/or permission-based system on Struts? Where can I implement the checking of the roles/permission? we have a servlet extending ActionServlet, can i use that servlet to implement this? |
|
|
|
Jul 28 2005, 04:23 AM
Post
#2
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 89 Joined: 27-July 05 From: AUSTRALINDIA Member No.: 9,896 |
First starting point is to create table user, role and user_role.
In role table make sure you have role like administratorm user, etc Once you have all this information, you create all form and related action classes. Based on the roles of the user you can mapp different action as shown bellow: <action-mappings> <action path="/user/main" type="com.something.user.AddUserAction" roles="administrator" validate="false" > <forward name="success" path="main.menu"/> </action> <action path="/user/main" type="com.something.user.UpdateUserAction" roles="user,administrator" validate="false" > <forward name="success" path="main.menu"/> </action> <action> ..... ..... </action> </action-mappings> There should be some tutorials out there....goooogled it. Good luck, it will be interesting... |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th October 2008 - 06:08 PM |