共用方式為


AuthorizationOptions.AddPolicy 方法

定義

多載

AddPolicy(String, AuthorizationPolicy)

新增具有所提供名稱的授權原則。

AddPolicy(String, Action<AuthorizationPolicyBuilder>)

新增從具有所提供名稱的委派建置的原則。

AddPolicy(String, AuthorizationPolicy)

來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
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>)

來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
AuthorizationOptions.cs
來源:
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>

將用來建置原則的委派。

適用於