AuthorizationBuilder.AddPolicy 方法

定义

重载

AddPolicy(String, AuthorizationPolicy)

AuthorizationPolicy添加可供 使用的 IAuthorizationService

AddPolicy(String, Action<AuthorizationPolicyBuilder>)

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

AddPolicy(String, AuthorizationPolicy)

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

AuthorizationPolicy添加可供 使用的 IAuthorizationService

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

参数

name
String

此策略的名称。

返回

生成器。

适用于

AddPolicy(String, Action<AuthorizationPolicyBuilder>)

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

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

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

参数

name
String

策略的名称。

configurePolicy
Action<AuthorizationPolicyBuilder>

将用于生成策略的委托。

返回

生成器。

适用于