Class SchedulerRolesAuthorizationExtensions
- Namespace
- Quartz
- Assembly
- Quartz.AspNetCore.dll
Builds an operation policy out of the application's roles. Added in 4.8.
public static class SchedulerRolesAuthorizationExtensions
- Inheritance
-
SchedulerRolesAuthorizationExtensions
- Inherited Members
Methods
RequireSchedulerRoles(AuthorizationPolicyBuilder, Action<SchedulerRoles>)
Requires the role an operation on a scheduler needs: a role in Viewers, Operators or Administrators at or above the Access the HTTP API, the dashboard or the agent asks with.
public static AuthorizationPolicyBuilder RequireSchedulerRoles(this AuthorizationPolicyBuilder builder, Action<SchedulerRoles> configure)
Parameters
builderAuthorizationPolicyBuilderThe policy being built.
configureAction<SchedulerRoles>Names the roles, and any per-operation overrides.
Returns
- AuthorizationPolicyBuilder
The same builder, so calls can be chained.
Remarks
Name the policy this builds in QuartzHttpApiOptions.OperationAuthorizationPolicy and
QuartzDashboardOptions.OperationAuthorizationPolicy; it is evaluated against a
SchedulerResource, and against nothing else it succeeds for nobody. The requirement is
its own handler, so nothing has to be registered beside AddAuthorization().
It says nothing about which schedulers a caller may see, which is what a
SchedulerAuthorizationPolicy is for; the two compose. Nor does it authenticate anybody: put
RequireAuthenticatedUser() in the same policy, or RequireAuthorization() on the mapped
endpoints, to have an anonymous caller challenged rather than refused.
Exceptions
- ArgumentNullException
builderorconfigureis null.- ArgumentException
No role is named, a role is blank, or Operations names an operation the HTTP API does not publish, a read, or a change at View.