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

  • Best practice to implement role-based views?

    Hi, i'm new to acegi security.
    As far as i can see it provides a very flexible system for securing applications and i want to use it in a new project.
    I have the requirement to present the users of my webapplication a view depending on their role.
    Is there a best practice or a recommended way to present the same page (a jsp for example) with a view depending on the users role?
    An Admin-User for example should be able to see additional menu-entries etc...
    Thanks in advance!
    lasse

  • #2
    Hi
    I have the similar requirement in my current project and i used Acegi Security and it was perfect.
    I got the roles of the resources from the database and send it to ConfigAttributeDefinition in the class which extends AbstractFilterInvocationDefinitionSource.
    Then Acegi will compare the roles of the user with the available roles for that particular resource and authorizes the Users accordingly.
    I have no problems in implementing it till now.

    Comment


    • #3
      Hi,

      i did role-based views by using the Acegi tags:

      Code:
      <authz:authorize ifAllGranted="ROLE_RM">
      <!-- <h3>You are a relationship Manager!!!!</h3> -->
      </authz:authorize>
      Works nicely.

      Cheers

      Rakesh

      Comment


      • #4
        Thx Rakesh,

        that was exactly what i was looking for!

        Comment

        Working...
        X