Class SchedulerResource
- Namespace
- Quartz
- Assembly
- Quartz.AspNetCore.dll
The scheduler a per-scheduler authorization policy is evaluated against: the resource passed to
IAuthorizationService.AuthorizeAsync(user, resource, policyName) by every HTTP API route and
every dashboard page that names a scheduler.
public sealed record SchedulerResource : IEquatable<SchedulerResource>
- Inheritance
-
SchedulerResource
- Implements
- Inherited Members
Remarks
Write an AuthorizationHandler<TRequirement, SchedulerResource> and the same decision
covers both surfaces. SchedulerName is the name the caller asked for, spelled as they
spelled it — scheduler lookups compare names ignoring case, so a handler that matches a claim against
it should do the same.
A scheduler reached through a target — w1/QuartzScheduler — arrives as the bare
SchedulerName with the target in Target, so a handler written against
the name keeps matching it, and one that cares which process the name was found in reads the target.
From 4.8 the same resource carries Operation and Access to an
OperationAuthorizationPolicy, which decides what the caller may do rather than which schedulers
they may see.
Constructors
SchedulerResource(string)
The scheduler a per-scheduler authorization policy is evaluated against: the resource passed to
IAuthorizationService.AuthorizeAsync(user, resource, policyName) by every HTTP API route and
every dashboard page that names a scheduler.
public SchedulerResource(string SchedulerName)
Parameters
SchedulerNamestringThe scheduler the request is about.
Remarks
Write an AuthorizationHandler<TRequirement, SchedulerResource> and the same decision
covers both surfaces. SchedulerName is the name the caller asked for, spelled as they
spelled it — scheduler lookups compare names ignoring case, so a handler that matches a claim against
it should do the same.
A scheduler reached through a target — w1/QuartzScheduler — arrives as the bare
SchedulerName with the target in Target, so a handler written against
the name keeps matching it, and one that cares which process the name was found in reads the target.
From 4.8 the same resource carries Operation and Access to an
OperationAuthorizationPolicy, which decides what the caller may do rather than which schedulers
they may see.
Properties
Access
The operator role the call needs — Administer for a trigger-now that
carries job data — or null on the resource a SchedulerAuthorizationPolicy is
evaluated against. Added in 4.8.
public SchedulerAccess? Access { get; init; }
Property Value
Remarks
The level the HTTP API's route table gives the operation, decided by the surface that asks, so a
handler compares roles with it rather than keeping a table of its own.
RequireSchedulerRoles is the handler Quartz ships.
Operation
The operation asked for, by the name the HTTP API publishes as its operation id — PauseJob,
Shutdown, GetJobDetails — or null when the question is only whether
the caller may see the scheduler. Added in 4.8.
public string? Operation { get; init; }
Property Value
Remarks
Never set on the resource a SchedulerAuthorizationPolicy is evaluated against, so a handler
written for that policy before 4.8 is asked the same question it always was. An
OperationAuthorizationPolicy is asked with it set, except for the dashboard's question whether
a visitor may see a scheduler at all, which carries Access View and no operation.
SchedulerName
The scheduler the request is about.
public string SchedulerName { get; init; }
Property Value
Target
The target the scheduler is reached through — the first half of its key, as SchedulerRef reads it — or null for one of this process, or one registered without a target. Added in 4.5.
public string? Target { get; init; }