Search code examples
asp.netvisual-studio-2008web-configrolesmembership

How to create a role in asp.net web.config file using my query ?


Deal All i have a query how to write the web.config file to perform my that operation mentioned below :

i have directory in my asp.net website namely BOSS inside BOSS directory i have IMAGE directory...

i have allow only admins to access BOSS directy but I want the Directory IMAGE inside BOSS will be accessed by all users of my site including Anonymous users.

Howto do that ...i have created a admin role for BOSS directory as :

<location path="boss">
    <system.web>
      <authorization>
        <allow roles="admin"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>

Solution

  • Aside from this sounding as a bit strange setup, since you're trying to have files in a folder have less restrictive access rights than your folders parent folder, I'm pretty sure this is not possible.

    I'd try to change to folder layout of your website, so that you don't need to provide this setup.