November Happy Hour will be moved to Thursday December 5th.

Class AuthorizationOptionsExtensions

Extends Microsoft.AspNetCore.Authorization.AuthorizationOptions with convenient methods

Inheritance
System.Object
AuthorizationOptionsExtensions
Namespace: EPiServer.Authorization
Assembly: EPiServer.Cms.AspNetCore.dll
Version: 12.0.3
Syntax
public static class AuthorizationOptionsExtensions : Object

Methods

TryAddPolicy(AuthorizationOptions, String, AuthorizationPolicy)

Adds a policy with given name if it does not already exist

Declaration
public static void TryAddPolicy(this AuthorizationOptions options, string name, AuthorizationPolicy policy)
Parameters
Type Name Description
Microsoft.AspNetCore.Authorization.AuthorizationOptions options
System.String name
Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy

TryAddPolicy(AuthorizationOptions, String, Action<AuthorizationPolicyBuilder>)

Adds a policy with given name if it does not already exist

Declaration
public static void TryAddPolicy(this AuthorizationOptions options, string name, Action<AuthorizationPolicyBuilder> configurePolicy)
Parameters
Type Name Description
Microsoft.AspNetCore.Authorization.AuthorizationOptions options
System.String name
System.Action<Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder> configurePolicy