Skip to content

PermissionCallbackProps

PermissionCallbackProps<TData, TUser, TOrg> = object & [TData] extends [never] ? unknown : object & [TOrg] extends [never] ? unknown : object

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

Props passed to a permission callback.

The data key exists only for data-carrying subjects; the organization key exists only when orgCollectionSlug is configured. Built with intersections (not conditional property types) so the keys are truly absent — not present-but-never — when unavailable.

user: TUser

TData = unknown

Document type for the subject; never when the subject has no data.

TUser = Record<string, unknown>

User document shape (registry lookup on the user collection slug).

TOrg = Record<string, unknown>

Organization document shape; never when not configured.