我们如何在网站的特定文件夹上应用安全授权 [英] How we can Apply security Authorization On a Particular Folder in a website

查看:65
本文介绍了我们如何在网站的特定文件夹上应用安全授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在网站上包含各种Web表单的特定文件夹上应用安全授权

我正在使用asp.net 4.0

How we can Apply security Authorization On a Particular Folder containing various webforms in a website

i am using asp.net 4.0

推荐答案

使用google找到了这个(google是所有人免费使用的,顺便说一句):

将一个单独的web.config文件放在所需的文件夹中,如果用户不是管理员角色,该文件将拒绝访问对该文件夹的每个请求.

看起来像这样:

Found this using google (google is free for everyone to use, BTW):

Place a separate web.config file in the desired folder that will deny access to every request to that folder if the user isn''t in the Admin role.

It would look something like this:

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


这篇关于我们如何在网站的特定文件夹上应用安全授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆