Skip to content

basalt / ai/src / injectPermissionGuards

Function: injectPermissionGuards() ​

> injectPermissionGuards(content, prefix): object

Defined in: ai/src/make/wire.ts:44

Inject meta: { can: '<prefix>.<action>' } into every generated route, so the permissions guard enforces it. prefix is the resource's permission namespace (e.g. patients) — derived per entity by the caller, so each entity in a multi-entity plan gets its own correct permission, not a shared one.

Parameters ​

content ​

string

prefix ​

string

Returns ​

object

content ​

> content: string

injected ​

> injected: boolean

Released under the MIT License.