Skip to content

@nogoo9/no-crd / index / verifyTemplateAccessOrThrow

Function: verifyTemplateAccessOrThrow()

verifyTemplateAccessOrThrow(annotations, jwtPayload, isAdmin?, templateRef?): void

Defined in: src/k8s/auth.ts:736

Verifies that the user has required roles/scopes specified in template annotations (nogoo9/allowed-roles, nogoo9/allowed-scopes). Admins always bypass template access restrictions. Evaluates using AND rule: caller must possess at least one allowed role AND at least one allowed scope if both annotations are present.

Parameters

annotations

Record<string, string> | undefined

jwtPayload

unknown

isAdmin?

boolean = false

templateRef?

string = "template"

Returns

void