JG Vimalan's Blog

It is all about coding!

Authorization in Web.Config file

Authorization for users / group to view certain pages under a folder or certain pages itself can be set in web.config file as shown below,

<location path=”Admin”>
    <system.web>
      <authorization>
        <allow users=”test\user1, test\user2, test\user3″ />
        <!– Only these people can access all the files under admin folder –>
        <deny users=”*” />
      </authorization>
    </system.web>
  </location>
  <location path=”Review.aspx”>
    <system.web>
      <authorization>
        <allow roles=”test\report group” />
        <!– Only this group can access the Review page –>
        <deny users=”*” />
      </authorization>
    </system.web>
  </location>

Advertisements

December 16, 2009 - Posted by | ASP.NET

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: