AuthorizeAttribute 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定对控制器或操作方法的访问只限于满足授权要求的用户。
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class AuthorizeAttribute : System.Web.Mvc.FilterAttribute, System.Web.Mvc.IAuthorizationFiltertype AuthorizeAttribute = class
    inherit FilterAttribute
    interface IAuthorizationFilterPublic Class AuthorizeAttribute
Inherits FilterAttribute
Implements IAuthorizationFilter- 继承
- 属性
- 实现
构造函数
| AuthorizeAttribute() | 初始化 AuthorizeAttribute 类的新实例。 | 
属性
| AllowMultiple | 获取或设置一个值,该值指示是否可指定筛选器特性的多个实例。(继承自 FilterAttribute) | 
| Order | 获取或者设置执行操作筛选器的顺序。(继承自 FilterAttribute) | 
| Roles | 获取或设置有权访问控制器或操作方法的用户角色。 | 
| TypeId | 获取此特性的唯一标识符。 | 
| Users | 获取或设置有权访问控制器或操作方法的用户。 | 
方法
| AuthorizeCore(HttpContextBase) | 重写时,提供一个入口点用于进行自定义授权检查。 | 
| HandleUnauthorizedRequest(AuthorizationContext) | 处理未能授权的 HTTP 请求。 | 
| OnAuthorization(AuthorizationContext) | 当进程请求授权时调用。 | 
| OnCacheAuthorization(HttpContextBase) | 在缓存模块请求授权时调用。 |