AuthorizationBuilder.SetDefaultPolicy(AuthorizationPolicy) 方法

定义

设置默认授权策略。 默认要求经过身份验证的用户。

public virtual Microsoft.AspNetCore.Authorization.AuthorizationBuilder SetDefaultPolicy (Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
abstract member SetDefaultPolicy : Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> Microsoft.AspNetCore.Authorization.AuthorizationBuilder
override this.SetDefaultPolicy : Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> Microsoft.AspNetCore.Authorization.AuthorizationBuilder
Public Overridable Function SetDefaultPolicy (policy As AuthorizationPolicy) As AuthorizationBuilder

参数

返回

生成器。

注解

在未指定策略名称的情况下进行评估 IAuthorizeData 时使用的默认策略。

适用于