Skip to content
rw3iss Auth

PermissionGate

atom @rw3iss/auth-client/preact/atoms/PermissionGate framework-adapters/preact/components/atoms/PermissionGate.tsx ↗

Render children only if the current user has the requested permission(s). Permission strings are resource:action codes (e.g. “users:read”, “orgs:members:invite”) — matches the server’s permission catalog.

Like RoleGate, system_admin always passes.

Usage

import { PermissionGate } from '@rw3iss/auth-client/preact/atoms';
<PermissionGate
children={<></>}
/>

Props

NameTypeDescription
childrenComponentChildren(required)
anyOfstring[]
allOfstring[]
fallbackComponentChildren
clientAuthClient