Skip to content

WithCan

WithCan<T> = T & object

Defined in: packages/db/src/types.ts:29

Augments a row type with a _can object containing per-action booleans.

Every query result from findMany / findFirst includes _can when the Db was created with grants and a user. Each CRUD action maps to true (permitted for this row), false (denied), or a row-dependent boolean when the grant has a where clause.

_can: Record<CrudAction, boolean>

T