AuthorizationBuilder.AddDefaultPolicy Method

Definition

Overloads

AddDefaultPolicy(String, AuthorizationPolicy)

Add a policy that is built from a delegate with the provided name and used as the default policy.

AddDefaultPolicy(String, Action<AuthorizationPolicyBuilder>)

Add a policy that is built from a delegate with the provided name and used as the DefaultPolicy.

AddDefaultPolicy(String, AuthorizationPolicy)

Source:
AuthorizationBuilder.cs
Source:
AuthorizationBuilder.cs
Source:
AuthorizationBuilder.cs

Add a policy that is built from a delegate with the provided name and used as the default policy.

public virtual Microsoft.AspNetCore.Authorization.AuthorizationBuilder AddDefaultPolicy (string name, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
abstract member AddDefaultPolicy : string * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> Microsoft.AspNetCore.Authorization.AuthorizationBuilder
override this.AddDefaultPolicy : string * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> Microsoft.AspNetCore.Authorization.AuthorizationBuilder
Public Overridable Function AddDefaultPolicy (name As String, policy As AuthorizationPolicy) As AuthorizationBuilder

Parameters

name
String

The name of the default policy.

Returns

The builder.

Applies to

AddDefaultPolicy(String, Action<AuthorizationPolicyBuilder>)

Source:
AuthorizationBuilder.cs
Source:
AuthorizationBuilder.cs
Source:
AuthorizationBuilder.cs

Add a policy that is built from a delegate with the provided name and used as the DefaultPolicy.

public virtual Microsoft.AspNetCore.Authorization.AuthorizationBuilder AddDefaultPolicy (string name, Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> configurePolicy);
abstract member AddDefaultPolicy : string * Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> -> Microsoft.AspNetCore.Authorization.AuthorizationBuilder
override this.AddDefaultPolicy : string * Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> -> Microsoft.AspNetCore.Authorization.AuthorizationBuilder
Public Overridable Function AddDefaultPolicy (name As String, configurePolicy As Action(Of AuthorizationPolicyBuilder)) As AuthorizationBuilder

Parameters

name
String

The name of the DefaultPolicy.

configurePolicy
Action<AuthorizationPolicyBuilder>

The delegate that will be used to build the DefaultPolicy.

Returns

The builder.

Applies to