Jump to content
xisto Community
clemen

Implementing Permission-based System Using Struts How to implement this

Recommended Posts

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?

Share this post


Link to post
Share on other sites

First starting point is to create table user, role and user_role.In role table make sure you have role like administratorm user, etcOnce 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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.