AuthorizationAttribute 成员

充当用来通过自定义元数据控制授权的类的基类。

以下各表列出了由 AuthorizationAttribute 类型公开的成员。

受保护 构造函数

  名称 说明
  AuthorizationAttribute 初始化 AuthorizationAttribute 类的新实例。

顶部

公共 属性

  名称 说明
public property ErrorMessage 获取或设置要在 ErrorMessage 中返回的文本错误消息或资源键。
public property ResourceType 获取或设置要用作 ErrorMessage 的资源管理器的 Type
public property TypeId  (继承自 Attribute

顶部

公共 方法

(另请参见 受保护 方法)

  名称 说明
public method Authorize 确定给定的主体对象是否获得了授权来执行给定的 AuthorizationContext 所描述的特定操作。
public method Equals  已重载。(继承自 Attribute
public methodstatic GetCustomAttribute  已重载。(继承自 Attribute
public methodstatic GetCustomAttributes  已重载。(继承自 Attribute
public method GetHashCode  (继承自 Attribute
public method GetType  (继承自 Object
public method IsDefaultAttribute  (继承自 Attribute
public methodstatic IsDefined  已重载。(继承自 Attribute
public method Match  (继承自 Attribute
public methodstatic ReferenceEquals  (继承自 Object
public method ToString  (继承自 Object

顶部

受保护 方法

  名称 说明
protected method Finalize  (继承自 Object
protected method FormatErrorMessage 对于当前的 AuthorizationAttribute 获取要显示给用户的、带有格式的错误消息。
protected method IsAuthorized 特定于实现的方法,用于确定给定的 IPrincipal 对象是否获得了授权来执行给定的 AuthorizationContext 对象所描述的特定操作。
protected method MemberwiseClone  (继承自 Object

顶部

显式接口实现

  名称 说明
  System.Runtime.InteropServices._Attribute.GetIDsOfNames  (继承自 Attribute
  System.Runtime.InteropServices._Attribute.GetTypeInfo  (继承自 Attribute
  System.Runtime.InteropServices._Attribute.GetTypeInfoCount  (继承自 Attribute
  System.Runtime.InteropServices._Attribute.Invoke  (继承自 Attribute

顶部

另请参见

参考

AuthorizationAttribute 类
System.ComponentModel.DataAnnotations 命名空间