AuthorizeAttribute Class

Definition

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
Inheritance
AuthorizeAttribute
Attributes
Implements

Constructors

AuthorizeAttribute()

Initializes a new instance of the AuthorizeAttribute class.

Properties

AllowMultiple

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

(Inherited from FilterAttribute)
Order

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

(Inherited from FilterAttribute)
Roles

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

TypeId

Gets the unique identifier for this attribute.

Users

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

Methods

AuthorizeCore(HttpContextBase)

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

HandleUnauthorizedRequest(AuthorizationContext)

Processes HTTP requests that fail authorization.

OnAuthorization(AuthorizationContext)

Called when a process requests authorization.

OnCacheAuthorization(HttpContextBase)

Called when the caching module requests authorization.

Applies to