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
fallbackif provided, otherwise nothing - Invisible: renders nothing (the resource does not exist for this user)
Parameters
Section titled “Parameters”See PermissionGateProps.
Returns
Section titled “Returns”Element | null
Example
Section titled “Example”<PermissionGate action={editPost} fallback={<ReadOnlyBanner />}> <EditToolbar /></PermissionGate>