给执行代码加 执行权限 角色管理[System.Security.Permission]
2009-08-23 21:39
615 查看
更多详细:http://weblogs.asp.net/scottgu/archive/2005/11/14/430598.aspx
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Authors aucmd = new Authors();
Response.Write(aucmd.pvHello());
}
}
//[PrincipalPermission(SecurityAction.Demand, Authenticated = true)]
public class Authors
{
// Methods
[PrincipalPermission(SecurityAction.Demand, Role = "Admin")]
public string pvHello()
{
return DateTime.Now.ToString();
}
}
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Authors aucmd = new Authors();
Response.Write(aucmd.pvHello());
}
}
//[PrincipalPermission(SecurityAction.Demand, Authenticated = true)]
public class Authors
{
// Methods
[PrincipalPermission(SecurityAction.Demand, Role = "Admin")]
public string pvHello()
{
return DateTime.Now.ToString();
}
}
相关文章推荐
- 使用membership(System.Web.Security)来进行角色与权限管理
- 使用membership(System.Web.Security)来进行角色与权限管理 (转)
- 使用membership(System.Web.Security)来进行角色与权限管理
- springBoot+springSecurity 数据库动态管理用户、角色、权限(二)
- RedGlovePermission 权限管理系统源码(支持自定义权限、模块,支持角色权限,用户独立权限以及多角色权限)
- RedGlovePermission 权限管理系统源码(支持自定义权限、模块,支持角色权限,用户独立权限以及多角色权限)
- oracle数据库创建用户、 创建角色和权限管理代码示例
- springBoot+springSecurity 数据库动态管理用户、角色、权限(二)
- Spring-Security权限管理框架(1)——根据角色权限登录
- oracle数据库创建用户、 创建角色和权限管理代码示例
- 角色权限管理系统相关代码以及数据库
- WINFORM 请求“System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”类型的权限已失败。
- springBoot+springSecurity 数据库动态管理用户、角色、权限
- 对ASP.NET网站执行代码覆盖率测试发生System.Security.VerificationException异常的解决方案
- WordPress用户角色及其权限管理编辑插件:User Role Editor汉化版
- ASP.NET MVC:窗体身份验证及角色权限管理示例
- Oracle sys和system用户、sysdba 和sysoper系统权限、sysdba和dba角色的区别
- 基于角色-资源-用户的权限管理设计
- 角色权限管理系统(角色功能授权)
- 采用easyui tree编写简单角色权限代码的方法