Where to mention Accessdenied page in form Authentication

Posted by Muhammad Akhtar on Stack Overflow See other posts from Stack Overflow or by Muhammad Akhtar
Published on 2009-12-10T12:03:59Z Indexed on 2010/04/04 5:53 UTC
Read the original article Hit count: 521

I have implement Form Authentication

 <location path="Admin">
 <system.web>
  <authorization>
    <deny users="?"/>
    <allow roles="Admin" />
    <deny roles="systemAdmin"/>
  </authorization>
  </system.web>
 </location>

Since in above mentioned rights, Admin can have access to Admin folder and systemAdmin can't have.

I have make custom Accessdenied page where I am showing message to user he has not permission to access this page

Now the issue is, If systemAdmin try to hit Admin folder page, he will be redirected to AccessDenied.apsx page. (please Note: both user are authenticated, 1 user have permission to some folder and other user have permission to other folder. I don't want to put check in each page)

where to specify accessdenied page redirection ?

Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about forms-authentication