Click here to Skip to main content
15,922,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can a rule be applied to a file instead of a folder using default role membership provider?

Thanks
SB
Posted

1 solution

Your question is a bit vague. Are you asking if it is possible to secure a specific file using config.web?

If so, then yes. It would look like this:
XML
<configuration>
   <location path="MyFile.ext">
      <system.web>
         <authorization>
            <allow users="?"/>
         </authorization>
      </system.web>
   </location>
</configuration>


The <authorization> element allows or denies access, exactly as if you were securing a folder. Note that each file requires its own <location> element, so this method is not very useful for securing a large number of files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900