AI Components / Permission Gate
Permission Gate
Role-based access control card built from cg-card / cg-text / cg-button / cg-badge primitives. Allow/deny icon per feature, "Request Access" CTA on denied items, and an allowed/denied summary footer.
ai-production v0.5.0
Playground
Examples
Editor role
<ai-permission-gate current-role="editor" style="max-width:440px;"></ai-permission-gate> Import
import { AiPermissionGate } from '@cognivo/components'; // Or tree-shake: import '@cognivo/components/ai-permission-gate'; Per-component imports ship only that component (~8 kB gzip).
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
permissions | {feature, role, allowed, reason?}[] | — | Permission entries |
current-role | string | "" | Active role to filter by (empty = show all) |
rounded | "none" | "sm" | "md" | "lg" | "full" | "lg" | Card border-radius variant |
Events
| Event | Detail | Description |
|---|---|---|
ai-permission-request | {feature, role} | Request Access clicked on a denied feature |