Skip to content

getGrantedActions

getGrantedActions(grants, table): GrantedAction[]

Defined in: packages/permissions/src/granted-actions.ts:32

Returns the distinct CRUD actions that are granted for a given table.

manage grants are expanded into the four CRUD actions. For each action, the result includes the matching grants and whether any of them is unrestricted (no where clause). Actions with no matching grant at all are excluded from the result.

Used by @cfast/db to build _can annotations on query results.

Grant[]

The user’s resolved permission grants.

object

The Drizzle table to check grants against.

GrantedAction[]

Array of GrantedAction objects for each permitted action.