Results 1 to 5 of 5

Thread: Acegi Security Framework

  1. #1
    Join Date
    Apr 2008
    Posts
    4

    Default 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. #2
    Join Date
    Nov 2006
    Location
    Edinburgh, Scotland
    Posts
    42

    Default

    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

  3. #3
    Join Date
    Apr 2008
    Posts
    4

    Default

    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.

  4. #4
    Join Date
    Jan 2008
    Location
    London, England
    Posts
    14

    Default

    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

  5. #5
    Join Date
    Apr 2008
    Posts
    4

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •