Skip to content

PermissionGate

PermissionGate(props): Element | null

Defined in: packages/ui/src/components/permission-gate.tsx:22

Conditionally renders children based on action permission status.

Accepts an ActionHookResult from useActions() and controls rendering based on the user’s permission level:

  • Permitted: renders children
  • Forbidden (not permitted, not invisible): renders fallback if provided, otherwise nothing
  • Invisible: renders nothing (the resource does not exist for this user)

PermissionGateProps

See PermissionGateProps.

Element | null

<PermissionGate action={editPost} fallback={<ReadOnlyBanner />}>
<EditToolbar />
</PermissionGate>