如何创建具有不同访问级别的菜单? [英] How to create a menu with diffrent access levels?
问题描述
我有四个不同的用户角色,每个用户都可以访问某些
页面.如何根据用户访问权限设置条件asp.net菜单
I have got four different user roles, with each user having access to certain
pages. How can I setup a conditional asp.net menu based on the user access
level?
推荐答案
像这样(假设您使用的是表单身份验证)
http://villagecoder.wordpress.com/2008/08/29 /creating-a-role-based-aspnet-menu/
like this (assuming you are using forms authentication)
http://villagecoder.wordpress.com/2008/08/29/creating-a-role-based-aspnet-menu/
通常,菜单链接到URL.所以..
在您的网络配置文件中有这样的
Usually the menu links to an URL. So..
In your web config file have like this
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
<location path="Default2.aspx">
<system.web>
<authorization>
<allow users="Jack" />
<deny users="*" />
</authorization>
</system.web>
</location>
因此,default2.aspx仅允许分配的用户使用.可以使用逗号分隔的用户.
有关更多详细信息,请参见此链接..
http://www.asp.net/security/tutorials/user-based-authorization-cs [^ ]
Microsoft文档
http://msdn.microsoft.com/en-us/library/wce3kxhd.aspx [ ^ ]
so the default2.aspx will be only allowed for the users assigned. Can use comma separated users.
For more detail refer this link..
http://www.asp.net/security/tutorials/user-based-authorization-cs[^]
the Microsoft documentation
http://msdn.microsoft.com/en-us/library/wce3kxhd.aspx[^]
ASP.NET Menu and SiteMap Security Trimming
Please leave you comment helps or not.
这篇关于如何创建具有不同访问级别的菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!