Table of Contents

Class AuthorizationContext

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

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

public class AuthorizationContext : ControllerContext
Inheritance
AuthorizationContext
Inherited Members

Constructors

AuthorizationContext()

Initializes a new instance of the AuthorizationContext class.

public AuthorizationContext()

AuthorizationContext(ControllerContext)

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

[Obsolete("The recommended alternative is the constructor AuthorizationContext(ControllerContext controllerContext, ActionDescriptor actionDescriptor).")]
public AuthorizationContext(ControllerContext controllerContext)

Parameters

controllerContext ControllerContext

The context within which the result is executed. The context information includes the controller, HTTP content, request context, and route data.

AuthorizationContext(ControllerContext, ActionDescriptor)

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

public AuthorizationContext(ControllerContext controllerContext, ActionDescriptor actionDescriptor)

Parameters

controllerContext ControllerContext

The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data.

actionDescriptor ActionDescriptor

An object that provides information about an action method, such as its name, controller, parameters, attributes, and filters.

Properties

ActionDescriptor

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

public virtual ActionDescriptor ActionDescriptor { get; set; }

Property Value

ActionDescriptor

The action descriptor for the action method that is marked by the AuthorizeAttribute attribute.

Result

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

public ActionResult Result { get; set; }

Property Value

ActionResult

The result that is returned by an action method.