I have an application based on Java/Struts/Hibernate. It has 2 types of users. Admin and Normal user. I created separate Struts pages for both roles and actions.
But when I type admin action in the URL after logged as Normal user, the admin pages are accessible to the normal user. How can I fix this?
i have entered action class of admin and user are in separate in xml pages and are included in the struts.xml
page. if you're using the application everything works fine.but consider an action in struts-admin, e.g.: adminHome
, it will be localhost:8080/app/adminHome
. if a normal user logged in, the URL will be localhost:8080/app/normalHome
. But if the normal user types changes normalHome
to adminHome
, he can access Admin pages.
UPDATE:
As I said earlier, I have admin and user actions in different packages in struts.xml
. Can I get its package name in Java? Then I compare with user_role
and direct to admin /normal
pages..