AuthorizationOptions.AddPolicy 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddPolicy(String, AuthorizationPolicy) |
使用提供的名称添加授权策略。 |
AddPolicy(String, Action<AuthorizationPolicyBuilder>) |
添加一个策略,该策略是从具有所提供的名称的委托生成的。 |
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
使用提供的名称添加授权策略。
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)
参数
- name
- String
策略的名称。
- policy
- AuthorizationPolicy
授权策略。
适用于
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
添加一个策略,该策略是从具有所提供的名称的委托生成的。
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))
参数
- name
- String
策略的名称。
- configurePolicy
- Action<AuthorizationPolicyBuilder>
将用于生成策略的委托。