tags:

views:

40

answers:

2
+1  Q: 

role based access

hi, i am using asp.net with c# .I have 5 roles such as manager,super user, team leader etc .Depending on the role the user sees the data as restricted to him ,only super user can manipulate that data etc.I am using forms authentication.Can anyone provide the code or any form of help is appriciated. Please help

A: 

Get started with the Beer House starter kit which is a complete example of how membership, role, profile, personalization etc providers are used along with some good re-usable code.

lakhlaniprashant.blogspot.com
+1  A: 

Say you have a page that allows a user to edit some data, called EditData.aspx, but you only want users belonging to certain roles to access that page, you would add the following to your web.config:

<configuration>
   <location path="EditData.aspx">
      <system.web>
         <authorization>
            <deny users="*"/>
            <allow roles="Manager, SuperUser"/>
         </authorization>
      </system.web>
   </location>
</configuration>
klausbyskov