AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
RequireAuthorization<TBuilder>(TBuilder) |
將預設授權原則新增至端點 (s) 。 |
RequireAuthorization<TBuilder>(TBuilder, AuthorizationPolicy) |
將授權原則新增至端點 () 。 |
RequireAuthorization<TBuilder>(TBuilder, IAuthorizeData[]) |
將具有指定 IAuthorizeData 之 的授權原則新增至端點 (s) 。 |
RequireAuthorization<TBuilder>(TBuilder, Action<AuthorizationPolicyBuilder>) |
將回呼所設定的新授權原則新增至端點 () 。 |
RequireAuthorization<TBuilder>(TBuilder, String[]) |
將具有指定名稱的授權原則新增至端點 (s) 。 |
RequireAuthorization<TBuilder>(TBuilder)
將預設授權原則新增至端點 (s) 。
public:
generic <typename TBuilder>
where TBuilder : Microsoft::AspNetCore::Builder::IEndpointConventionBuilder[System::Runtime::CompilerServices::Extension]
static TBuilder RequireAuthorization(TBuilder builder);
public static TBuilder RequireAuthorization<TBuilder> (this TBuilder builder) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireAuthorization : 'Builder -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireAuthorization(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder) As TBuilder
類型參數
- TBuilder
參數
- builder
- TBuilder
端點慣例產生器。
傳回
TBuilder
原始慣例產生器參數。
適用於
RequireAuthorization<TBuilder>(TBuilder, AuthorizationPolicy)
將授權原則新增至端點 () 。
public static TBuilder RequireAuthorization<TBuilder> (this TBuilder builder, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireAuthorization : 'Builder * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireAuthorization(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, policy As AuthorizationPolicy) As TBuilder
類型參數
- TBuilder
參數
- builder
- TBuilder
端點慣例產生器。
- policy
- AuthorizationPolicy
原則 AuthorizationPolicy 。
傳回
TBuilder
原始慣例產生器參數。
適用於
RequireAuthorization<TBuilder>(TBuilder, IAuthorizeData[])
將具有指定 IAuthorizeData 之 的授權原則新增至端點 (s) 。
public:
generic <typename TBuilder>
where TBuilder : Microsoft::AspNetCore::Builder::IEndpointConventionBuilder[System::Runtime::CompilerServices::Extension]
static TBuilder RequireAuthorization(TBuilder builder, ... cli::array <Microsoft::AspNetCore::Authorization::IAuthorizeData ^> ^ authorizeData);
public static TBuilder RequireAuthorization<TBuilder> (this TBuilder builder, params Microsoft.AspNetCore.Authorization.IAuthorizeData[] authorizeData) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireAuthorization : 'Builder * Microsoft.AspNetCore.Authorization.IAuthorizeData[] -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireAuthorization(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, ParamArray authorizeData As IAuthorizeData()) As TBuilder
類型參數
- TBuilder
參數
- builder
- TBuilder
端點慣例產生器。
- authorizeData
- IAuthorizeData[]
authorizeData
的集合。 如果空白,則會使用預設授權原則。
傳回
TBuilder
原始慣例產生器參數。
適用於
RequireAuthorization<TBuilder>(TBuilder, Action<AuthorizationPolicyBuilder>)
將回呼所設定的新授權原則新增至端點 () 。
public static TBuilder RequireAuthorization<TBuilder> (this TBuilder builder, Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> configurePolicy) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireAuthorization : 'Builder * Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireAuthorization(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, configurePolicy As Action(Of AuthorizationPolicyBuilder)) As TBuilder
類型參數
- TBuilder
參數
- builder
- TBuilder
端點慣例產生器。
- configurePolicy
- Action<AuthorizationPolicyBuilder>
用來設定原則的回呼。
傳回
TBuilder
原始慣例產生器參數。
適用於
RequireAuthorization<TBuilder>(TBuilder, String[])
將具有指定名稱的授權原則新增至端點 (s) 。
public:
generic <typename TBuilder>
where TBuilder : Microsoft::AspNetCore::Builder::IEndpointConventionBuilder[System::Runtime::CompilerServices::Extension]
static TBuilder RequireAuthorization(TBuilder builder, ... cli::array <System::String ^> ^ policyNames);
public static TBuilder RequireAuthorization<TBuilder> (this TBuilder builder, params string[] policyNames) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member RequireAuthorization : 'Builder * string[] -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function RequireAuthorization(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder, ParamArray policyNames As String()) As TBuilder
類型參數
- TBuilder
參數
- builder
- TBuilder
端點慣例產生器。
- policyNames
- String[]
原則名稱的集合。 如果空白,則會使用預設授權原則。
傳回
TBuilder
原始慣例產生器參數。