【发布时间】:2009-08-19 11:58:27
【问题描述】:
如果某人没有特定角色,我可以使用<authorization> 来保护网络表单不被访问吗?
我试过了:
<authentication mode="windows" />
<authorization>
<allow roles="Admin" />
<deny users="*" />
</authorization>
但是如果管理员角色不可用,那么我仍然可以通过输入 URL 来访问该页面。如何保护此页面?
我阅读了 MSDN (ASP.NET Authorization) 上的文档。
我还在web.config 中添加了额外的UrlAuthorizeModule,以确保它被击中。
【问题讨论】:
-
我在 web.config 的根标签末尾添加了它。
标签: asp.net webforms authorization