AuthorizationEndpointConventionBuilderExtensions.RequireAuthorization 方法

定义

重载

RequireAuthorization<TBuilder>(TBuilder)

将默认授权策略添加到终结点 () 。

RequireAuthorization<TBuilder>(TBuilder, AuthorizationPolicy)

将授权策略添加到终结点 () 。

RequireAuthorization<TBuilder>(TBuilder, IAuthorizeData[])

将具有指定 IAuthorizeData 的授权策略添加到终结点 () 。

RequireAuthorization<TBuilder>(TBuilder, Action<AuthorizationPolicyBuilder>)

将回调配置的新授权策略添加到终结点 () 。

RequireAuthorization<TBuilder>(TBuilder, String[])

将具有指定名称的授权策略添加到终结点 () 。

RequireAuthorization<TBuilder>(TBuilder)

Source:
AuthorizationEndpointConventionBuilderExtensions.cs

将默认授权策略添加到终结点 () 。

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)

Source:
AuthorizationEndpointConventionBuilderExtensions.cs

将授权策略添加到终结点 () 。

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

终结点约定生成器。

返回

TBuilder

原始约定生成器参数。

适用于

RequireAuthorization<TBuilder>(TBuilder, IAuthorizeData[])

Source:
AuthorizationEndpointConventionBuilderExtensions.cs

将具有指定 IAuthorizeData 的授权策略添加到终结点 () 。

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>)

Source:
AuthorizationEndpointConventionBuilderExtensions.cs

将回调配置的新授权策略添加到终结点 () 。

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[])

Source:
AuthorizationEndpointConventionBuilderExtensions.cs

将具有指定名称的授权策略添加到终结点 () 。

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

原始约定生成器参数。

适用于