PermissionDescriptor
PermissionDescriptor =
object
Defined in: packages/permissions/src/types.ts:355
Structural description of a permission requirement.
Describes what kind of operation on which table without specifying concrete row values. This is what makes client-side permission introspection possible: you can check whether a role has the right grants without knowing the specific row being accessed.
The table field accepts either a Drizzle table object or a string table
name; both forms are normalized to the same key by getTableName.
Example
Section titled “Example”const descriptor: PermissionDescriptor = { action: "update", table: posts, // object form};
const descriptor2: PermissionDescriptor = { action: "create", table: "posts", // string form};Properties
Section titled “Properties”action
Section titled “action”action:
PermissionAction
Defined in: packages/permissions/src/types.ts:357
The operation being checked.
table:
DrizzleTable|string
Defined in: packages/permissions/src/types.ts:359
The Drizzle table or string table name the operation targets.