AuthorizationBuilder.AddDefaultPolicy 方法

定义

重载

AddDefaultPolicy(String, AuthorizationPolicy)

添加一个策略,该策略是从具有提供的名称的委托生成的,并用作默认策略。

AddDefaultPolicy(String, Action<AuthorizationPolicyBuilder>)

添加一个策略,该策略是从具有所提供的名称的委托生成的,并用作 DefaultPolicy 的策略。

AddDefaultPolicy(String, AuthorizationPolicy)

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

添加一个策略,该策略是从具有提供的名称的委托生成的,并用作默认策略。

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

参数

name
String

默认策略的名称。

返回

生成器。

适用于

AddDefaultPolicy(String, Action<AuthorizationPolicyBuilder>)

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

添加一个策略,该策略是从具有所提供的名称的委托生成的,并用作 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

参数

name
String

DefaultPolicy 的名称。

configurePolicy
Action<AuthorizationPolicyBuilder>

将用于生成 DefaultPolicy 的委托。

返回

生成器。

适用于