AuthorizationContext Class


Encapsulates the information that is required for using an AuthorizeAttribute attribute.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Inheritance Hierarchy



public class AuthorizationContext : ControllerContext
public ref class AuthorizationContext : ControllerContext
type AuthorizationContext = 
        inherit ControllerContext
Public Class AuthorizationContext
    Inherits ControllerContext


Name Description
System_CAPS_pubmethod AuthorizationContext()

Initializes a new instance of the AuthorizationContext class.

System_CAPS_pubmethod AuthorizationContext(ControllerContext)

Obsolete.Initializes a new instance of the AuthorizationContext class using the specified controller context.

System_CAPS_pubmethod AuthorizationContext(ControllerContext, ActionDescriptor)

Initializes a new instance of the AuthorizationContext class using the specified controller context and action descriptor.


Name Description
System_CAPS_pubproperty ActionDescriptor

Provides information about the action method that is marked by the AuthorizeAttribute attribute, such as its name, controller, parameters, attributes, and filters.

System_CAPS_pubproperty Controller

Gets or sets the controller.(Inherited from ControllerContext.)

System_CAPS_pubproperty DisplayMode

Gets the display mode.(Inherited from ControllerContext.)

System_CAPS_pubproperty HttpContext

Gets or sets the HTTP context.(Inherited from ControllerContext.)

System_CAPS_pubproperty IsChildAction

Gets a value that indicates whether the associated action method is a child action.(Inherited from ControllerContext.)

System_CAPS_pubproperty ParentActionViewContext

Gets an object that contains the view context information for the parent action method.(Inherited from ControllerContext.)

System_CAPS_pubproperty RequestContext

Gets or sets the request context.(Inherited from ControllerContext.)

System_CAPS_pubproperty Result

Gets or sets the result that is returned by an action method.

System_CAPS_pubproperty RouteData

Gets or sets the URL route data.(Inherited from ControllerContext.)


Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)


When an action method is marked with the AuthorizeAttribute attribute, an AuthorizationContext instance is passed to the OnAuthorization method. The AuthorizationContext class encapsulates information about the controller, HTTP context, request context, route data, action descriptor, and action result.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.Mvc Namespace

Return to top