Share via


AuthorizationBuilder.SetFallbackPolicy(AuthorizationPolicy) Method

Definition

Sets the fallback authorization policy used by CombineAsync(IAuthorizationPolicyProvider, IEnumerable<IAuthorizeData>) when no IAuthorizeData have been provided. As a result, the AuthorizationMiddleware uses the fallback policy if there are no IAuthorizeData instances for a resource. If a resource has any IAuthorizeData then they are evaluated instead of the fallback policy. By default the fallback policy is null, and usually will have no effect unless you have the AuthorizationMiddleware in your pipeline. It is not used in any way by the default IAuthorizationService.

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

Parameters

Returns

The builder.

Applies to