AuthorizeAttribute AuthorizeAttribute AuthorizeAttribute Class


Specifies that access to a controller or action method is restricted to users who meet the authorization requirement.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class AuthorizeAttribute : System.Web.Mvc.FilterAttribute, System.Web.Mvc.IAuthorizationFilter
type AuthorizeAttribute = class
    inherit FilterAttribute
    interface IAuthorizationFilter
Public Class AuthorizeAttribute
Inherits FilterAttribute
Implements IAuthorizationFilter


AuthorizeAttribute() AuthorizeAttribute() AuthorizeAttribute()

Initializes a new instance of the AuthorizeAttribute class.


AllowMultiple AllowMultiple AllowMultiple

Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified.

(Inherited from FilterAttribute)
Order Order Order

Gets or sets the order in which the action filters are executed.

(Inherited from FilterAttribute)
Roles Roles Roles

Gets or sets the user roles that are authorized to access the controller or action method.

TypeId TypeId TypeId

Gets the unique identifier for this attribute.

Users Users Users

Gets or sets the users that are authorized to access the controller or action method.


AuthorizeCore(HttpContextBase) AuthorizeCore(HttpContextBase) AuthorizeCore(HttpContextBase)

When overridden, provides an entry point for custom authorization checks.

HandleUnauthorizedRequest(AuthorizationContext) HandleUnauthorizedRequest(AuthorizationContext) HandleUnauthorizedRequest(AuthorizationContext)

Processes HTTP requests that fail authorization.

OnAuthorization(AuthorizationContext) OnAuthorization(AuthorizationContext) OnAuthorization(AuthorizationContext)

Called when a process requests authorization.

OnCacheAuthorization(HttpContextBase) OnCacheAuthorization(HttpContextBase) OnCacheAuthorization(HttpContextBase)

Called when the caching module requests authorization.

Applies to