Edit

Share via


AuthorizationContext Constructors

Definition

Initializes a new instance of the AuthorizationContext class.

Overloads

AuthorizationContext(ClaimsPrincipal, Collection<Claim>, Collection<Claim>)

Initializes a new instance of the AuthorizationContext class with the specified principal, resource claim, and action claim.

AuthorizationContext(ClaimsPrincipal, String, String)

Initializes a new instance of the AuthorizationContext class with the specified principal, resource name, and action name.

AuthorizationContext(ClaimsPrincipal, Collection<Claim>, Collection<Claim>)

Initializes a new instance of the AuthorizationContext class with the specified principal, resource claim, and action claim.

public:
 AuthorizationContext(System::Security::Claims::ClaimsPrincipal ^ principal, System::Collections::ObjectModel::Collection<System::Security::Claims::Claim ^> ^ resource, System::Collections::ObjectModel::Collection<System::Security::Claims::Claim ^> ^ action);
public AuthorizationContext (System.Security.Claims.ClaimsPrincipal principal, System.Collections.ObjectModel.Collection<System.Security.Claims.Claim> resource, System.Collections.ObjectModel.Collection<System.Security.Claims.Claim> action);
new System.Security.Claims.AuthorizationContext : System.Security.Claims.ClaimsPrincipal * System.Collections.ObjectModel.Collection<System.Security.Claims.Claim> * System.Collections.ObjectModel.Collection<System.Security.Claims.Claim> -> System.Security.Claims.AuthorizationContext
Public Sub New (principal As ClaimsPrincipal, resource As Collection(Of Claim), action As Collection(Of Claim))

Parameters

principal
ClaimsPrincipal

The principal for which authorization is to be checked.

resource
Collection<Claim>

A collection of claims that represents the resource for which the principal is to be authorized. The collection typically contains a single element.

action
Collection<Claim>

A collection of claims that represents the action to be performed on the resource. The collection typically contains a single element.

Exceptions

principal is null.

-or-

resource is null.

-or-

action is null.

Applies to

AuthorizationContext(ClaimsPrincipal, String, String)

Initializes a new instance of the AuthorizationContext class with the specified principal, resource name, and action name.

public:
 AuthorizationContext(System::Security::Claims::ClaimsPrincipal ^ principal, System::String ^ resource, System::String ^ action);
public AuthorizationContext (System.Security.Claims.ClaimsPrincipal principal, string resource, string action);
new System.Security.Claims.AuthorizationContext : System.Security.Claims.ClaimsPrincipal * string * string -> System.Security.Claims.AuthorizationContext
Public Sub New (principal As ClaimsPrincipal, resource As String, action As String)

Parameters

principal
ClaimsPrincipal

The principal for which authorization is to be checked.

resource
String

The resource for which the principal is to be authorized. The resource is specified as the value of a name claim.

action
String

The action to be performed on the resource. The action is specified as the value of a name claim.

Exceptions

principal is null.

-or-

resource is null.

-or-

action is null.

Remarks

The Action property is initialized to contain a name claim (ClaimTypes.Name) that has the value specified by the action parameter. The Resource property is initialized to contain a name claim that has the value specified by the resource parameter.

Applies to