Function: defineResourceAuthz()
function defineResourceAuthz(input: Record<string, ResourceAuthzDef>): ResourceAuthzRegistry;Defined in: shared/access/registry.ts:174
Register, per resource type, which selector fields are indexable (and the DB
column each maps to). authorizedWhere compiles only these into a Prisma
where; non-indexable fields force a partial result.
Parameters
| Parameter | Type |
|---|---|
input | Record<string, ResourceAuthzDef> |
Returns
Example
const registry = defineResourceAuthz({
product: { indexableAttributes: { vendorOrgId: "vendorOrgId", status: "status" } },
});