10using System.Threading.Tasks;
11using Microsoft.AspNetCore.Authorization;
12using Microsoft.Extensions.Options;
21 private readonly AuthorizationOptions _options;
31 throw new ArgumentNullException(nameof(options));
34 _options = options.Value;
60 var policy = _options.GetPolicy(policyName);
63 var policyBuilder =
new AuthorizationPolicyBuilder();
64 policyBuilder.AddRequirements(requirement);
65 policy = policyBuilder.Build();
67 _options.AddPolicy(policyName, policy);
70 return Task.FromResult(policy);
CSLA permissions requirement.
CSLA permissions policy provider.
Task< AuthorizationPolicy > GetDefaultPolicyAsync()
Gets the default policy
CslaPermissionsPolicyProvider(IOptions< AuthorizationOptions > options)
Creates an instance of the type
Task< AuthorizationPolicy > GetFallbackPolicyAsync()
Gets the fallback policy
Task< AuthorizationPolicy > GetPolicyAsync(string policyName)
Gets the authorization policy