Announcement Announcement Module
Collapse
No announcement yet.
Acegi Security Framework Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acegi Security Framework

    Hi,
    I am working on Acegi. I need an example for how to let few users access only few buttons/links on the same page where as others can access everything. I mean if User A has access to more than few items on the web page, where as user B has access to only few. I would like to know how we can implement this using Acegi. If possible please give me an example or sample app.

    Thanks,
    Maluri

  • #2
    Take a look at the acegi / spring security tag libs. You can hide links / buttons etc based on the users role. The eample below would only show the link if the user has the role ROLE_SWITCH_USER.

    Code:
    <authz:authorize ifAllGranted="ROLE_SWITCH_USER">
        <a href="<c:url value="/switchUser.html"/>"><spring:message code="SwitchUser.menu"/></a>
    </authz:authorize>
    Cheers
    Neil

    Comment


    • #3
      Thanks Neil. But I need acegi example for the below scenario.

      In the DAO layer, I want to call some method. Let's say getValues(). When user1 calls this method, he should get all the items in the database on the page. When user2 calls the same method he should get only few items from the database. How is this possible with Acegi. If possible please provide me with an example.

      Comment


      • #4
        Have a look at the contacts sample that comes with Acegi. It covers exactly the situation you describe.

        http://www.acegisecurity.org/suggested.html

        Paul

        Comment


        • #5
          Thanks Paul. I got the source code downloaded into my system. This is really helpful.

          Comment

          Working...
          X