Skip to content

CaslBehavior

Defined in: packages/pipeline-casl/src/casl.behavior.ts:40

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. A handler without rules runs without loading permissions.

new CaslBehavior(source): CaslBehavior

Defined in: packages/pipeline-casl/src/casl.behavior.ts:43

ICaslPermissionSource

CaslBehavior

readonly static [PIPELINE_BEHAVIOR_ID]: "@nestjs-pipeline/casl:CaslBehavior" = CASL_BEHAVIOR_ID

Defined in: packages/pipeline-casl/src/casl.behavior.ts:41

handle(context, next): Promise<unknown>

Defined in: packages/pipeline-casl/src/casl.behavior.ts:48

IPipelineContext

NextDelegate

Promise<unknown>

IPipelineBehavior.handle