Roles permissions
A matrix of roles against permissions.
Permissions apply to everyone in the role, the moment you save.
| Permission | Owner1 member | Admin2 members | Editor3 members | Viewer1 member |
|---|---|---|---|---|
| Work | ||||
| View projects | ||||
| Edit projects | ||||
| Publish changesMake edits live for customers | ||||
| Delete projects | ||||
| People | ||||
| Invite people | ||||
| Change roles | ||||
| Remove people | ||||
| Billing | ||||
| View invoices | ||||
| Change plan |
When to use
- Defining who can do what.
When not to use
- Few roles.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/roles-permissions
Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
RolesPermissions
6 props
PropTypeDefaultDescription
roles *readonly Role[]—
groups *readonly PermissionGroup[]—
value *Readonly<Record<string, readonly string[]>>—The saved matrix: role id to the permission ids it has.
onSave *(next: Readonly<Record<string, readonly string[]>>) => void—
onCreateRole((name: string) => void)—Called with a new role's name. It starts with the permissions of the first editable role.
classNamestring—
Keyboard
- Escape
- Closes or cancels, then returns focus to where it came from.
Accessibility
It exposes region and status semantics, with aria-label and aria-hidden kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/roles-permissions.mdThe index of every part is at /llms.txt.