基于角色的安全 [英] role-based-security
本文介绍了基于角色的安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发了一个使用基于角色的安全性的应用程序.
已配置应用程序域的主要策略:
I developed an application that uses roles-base-security.
The principal policy of the application domain is configurated:
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
我想限制对应用程序中方法之一的访问
I want to restrict access to one of the methods in the application
and allow only users who have the role "admin" to be able to call the method.
推荐答案
[PrincipalPermission(SecurityAction.Demand, Role = "Admin")]
protected void UserInfo_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
}
这篇关于基于角色的安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文