Beispiel #1
0
        private string GetRoleCodeByRoleActionType(RoleActionType actionType)
        {
            switch (actionType)
            {
            case RoleActionType.Insert:
                Description = "新增";
                return("INSERT");

            case RoleActionType.Update:
                Description = "编辑";
                return("UPDATE");

            case RoleActionType.Select:
                Description = "查询";
                return("SELECT");

            case RoleActionType.Delete:
                Description = "删除";
                return("DELETE");

            default:
                throw new ArgumentException("无法找到对应操作形式的权限代码", "actionType");
            }
        }
Beispiel #2
0
 public RoleAction(RoleActionType roleActionType)
 {
     this.roleActionType = roleActionType;
 }
Beispiel #3
0
 public AdminAuthorizeAttribute(RoleActionType roleActionType, AuthenticationType type) : base(roleActionType, type)
 {
 }
Beispiel #4
0
 public AdminAuthorizeAttribute(RoleActionType roleActionType) : base(roleActionType)
 {
 }
Beispiel #5
0
 /// <summary>
 /// 通过基本操作类型作为权限代码和授权用户类型设置函数权限
 /// </summary>
 public RoleAuthorizeAttribute(RoleActionType roleActionType, AuthenticationType type)
 {
     this.RoleCode           = GetRoleCodeByRoleActionType(roleActionType);
     this.AuthenticationType = type;
 }
Beispiel #6
0
 /// <summary>
 /// 通过基本操作类型作为权限代码设置函数权限
 /// </summary>
 public RoleAuthorizeAttribute(RoleActionType roleActionType)
 {
     this.RoleCode = GetRoleCodeByRoleActionType(roleActionType);
 }