Back Forum Reply New

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

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:
lt;authz:authorize ifAllGranted=quot;ROLE_SWITCH_USERquot;gt;   lt;a hrcf=quot;lt;c:ucl value=quot;/switchUser.htmlquot;/gt;quot;gt;lt;spring:message code=quot;SwitchUser.menuquot;/gt;lt;/agt;
lt;/authz:authorizegt;
Cheers
Neil

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.

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

suggested.html

Paul

Thanks Paul.  I got the source code downloaded into my system.  This is really helpful.
¥
Back Forum Reply New