AuthorizationBuilder.AddDefaultPolicy 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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
默认策略的名称。
- policy
- AuthorizationPolicy
默认 AuthorizationPolicy。>
返回
生成器。
适用于
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 的委托。
返回
生成器。