Skip to content

@xtandard/webhooks/authorization/roles

Role-based authorization: rolesAuthorization() maps role names to the actions they grant (built-in admin/editor/viewer policy by default), with a readonly switch that denies every mutating action.

import { … } from "@xtandard/webhooks/authorization/roles";
Name Summary
rolesAuthorization Create a role-based AuthorizationProvider.
Name Summary
RolesAuthorizationOptions Options for rolesAuthorization.
Name Summary
RolePolicy A role policy: each role maps to an explicit action list or the "*" wildcard.
Name Summary
ALL_ACTIONS Every action in the system, used to expand non-wildcard “all actions” presets.
DEFAULT_ROLE_POLICY The default role policy applied when RolesAuthorizationOptions.policy is omitted.
READ_ACTIONS Every read-only action (the *:read subset of ALL_ACTIONS). endpoint:read-secret is deliberately excluded — secret access is sensitive and must be granted explicitly.