Dela via


AuthorizationOptions.AddPolicy Method

Definition

Overloads

AddPolicy(String, AuthorizationPolicy)

Add an authorization policy with the provided name.

AddPolicy(String, Action<AuthorizationPolicyBuilder>)

Add a policy that is built from a delegate with the provided name.

AddPolicy(String, AuthorizationPolicy)

Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs

Add an authorization policy with the provided name.

public:
 void AddPolicy(System::String ^ name, Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy);
public void AddPolicy (string name, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
member this.AddPolicy : string * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> unit
Public Sub AddPolicy (name As String, policy As AuthorizationPolicy)

Parameters

name
String

The name of the policy.

policy
AuthorizationPolicy

The authorization policy.

Applies to

AddPolicy(String, Action<AuthorizationPolicyBuilder>)

Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs
Source:
AuthorizationOptions.cs

Add a policy that is built from a delegate with the provided name.

public:
 void AddPolicy(System::String ^ name, Action<Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^> ^ configurePolicy);
public void AddPolicy (string name, Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> configurePolicy);
member this.AddPolicy : string * Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> -> unit
Public Sub AddPolicy (name As String, configurePolicy As Action(Of AuthorizationPolicyBuilder))

Parameters

name
String

The name of the policy.

configurePolicy
Action<AuthorizationPolicyBuilder>

The delegate that will be used to build the policy.

Applies to