CaslBehavior
Defined in: packages/pipeline-casl/src/casl.behavior.ts:38
Type-level authorization before the handler runs.
Loads the caller through ICaslPermissionSource, builds the ability, stores
it and the principal in context.items for CaslAuthorizer and
security-scoped keys, and throws UnauthorizedActionException unless every
requirement passes. An unauthenticated caller (null input) is denied.
Errors from the source or from malformed rules propagate unchanged.
Placed globally, it passes a handler that declares no rules without loading
permissions; a handler that places it itself must declare them, which the
pipeline diagnostics check.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CaslBehavior(
source):CaslBehavior
Defined in: packages/pipeline-casl/src/casl.behavior.ts:62
Parameters
Section titled “Parameters”source
Section titled “source”Returns
Section titled “Returns”CaslBehavior
Properties
Section titled “Properties”[PIPELINE_BEHAVIOR_CONTRACT]
Section titled “[PIPELINE_BEHAVIOR_CONTRACT]”
readonlystatic[PIPELINE_BEHAVIOR_CONTRACT]:IPipelineBehaviorContract
Defined in: packages/pipeline-casl/src/casl.behavior.ts:45
A call-site declaration must name what it requires: without rules the handler would run unchecked. A global declaration may stay without rules.
[PIPELINE_BEHAVIOR_ID]
Section titled “[PIPELINE_BEHAVIOR_ID]”
readonlystatic[PIPELINE_BEHAVIOR_ID]:"@cqrs-ddd/pipeline-casl:CaslBehavior"=CASL_BEHAVIOR_ID
Defined in: packages/pipeline-casl/src/casl.behavior.ts:39
Methods
Section titled “Methods”handle()
Section titled “handle()”handle(
context,next):Promise<unknown>
Defined in: packages/pipeline-casl/src/casl.behavior.ts:70
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”Promise<unknown>