Skip to content

PermissionCheck

PermissionCheck<TData, TUser, TOrg, TIndexFields> = BasePermissionCheck<TData, TUser, TOrg> | ConstrainedPermissionCheck<TData, TUser, TOrg, TIndexFields>

Defined in: packages/core/src/access/types.ts:369

A single permission check on a query-shaped action: the plain leaf shapes, and the narrowing object form with withIndex available.

The ONLY difference from AnyActionPermissionCheck is that withIndex is present here — on a mutation action TIndexFields is never, so the property resolves to never and declaring it is a type error at the property, rather than a whole-object shape rejection pointing at the wrong line.

A callback returning undefined is treated as deny.

TData = unknown

Document type for the subject.

TUser = Record<string, unknown>

User document shape.

TOrg = Record<string, unknown>

Organization document shape; never if not configured.

TIndexFields extends Record<string, readonly string[]> = Record<string, readonly string[]>

The resource’s index name → field tuple map, which withIndex resolves against.