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"); } }
public RoleAction(RoleActionType roleActionType) { this.roleActionType = roleActionType; }
public AdminAuthorizeAttribute(RoleActionType roleActionType, AuthenticationType type) : base(roleActionType, type) { }
public AdminAuthorizeAttribute(RoleActionType roleActionType) : base(roleActionType) { }
/// <summary> /// 通过基本操作类型作为权限代码和授权用户类型设置函数权限 /// </summary> public RoleAuthorizeAttribute(RoleActionType roleActionType, AuthenticationType type) { this.RoleCode = GetRoleCodeByRoleActionType(roleActionType); this.AuthenticationType = type; }
/// <summary> /// 通过基本操作类型作为权限代码设置函数权限 /// </summary> public RoleAuthorizeAttribute(RoleActionType roleActionType) { this.RoleCode = GetRoleCodeByRoleActionType(roleActionType); }