Announcement Announcement Module
No announcement yet.
Best practice recommendation regarding role based views Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best practice recommendation regarding role based views


    is there a recommended practice creating a login based web app with multiple views based on the role of the logged in user?

    I have a login page where a user logs in. Now, the app should redirect the user to different areas. Let's say a user with the role Admin logs in, then all he sees is below /admin, a editor logs in and sees all pages under /editor.

    Ok, honestly I am searching for a HOW-TO not a best practice recommandation...


  • #2
    You'd be using AuthenticationProcessingFilter, which subclasses AbstractProcessingFilter. The latter has an alwaysUseDefaultTargetUrl. I'd set it to true, and specify the URL with the defaultTargetUrl property. If you need different redirects based on the roles held, write a JSP that uses the <authz> taglib and sends a response redirect to the browser.