RefactKit’s RBAC system is built on Better Auth’sDocumentation Index
Fetch the complete documentation index at: https://docs.refactkit.com/llms.txt
Use this file to discover all available pages before exploring further.
createAccessControl API. Every organization member is assigned one of three roles — member, admin, or owner — and each role grants a specific set of permissions over resources like members, invitations, and the organization itself. Permissions are enforced server-side in every server function, so unauthorized actions are rejected before any database query runs.
Roles
| Role | Description |
|---|---|
| Member | Read-only access to the dashboard. Cannot manage other members, invitations, or organization settings. Suitable for end users who need workspace access but no administrative control. |
| Admin | Can manage members (except owners) and invitations. Cannot update or delete the organization itself, and cannot remove members with the Owner role. |
| Owner | Full control over the organization. Can update or delete the organization, manage all members including other admins, and transfer ownership. There must always be at least one owner per organization. |
Permission matrix
The table below lists every permission in the system and which roles have it.| Permission | Member | Admin | Owner |
|---|---|---|---|
dashboard:read | ✅ | ✅ | ✅ |
member:read | ❌ | ✅ | ✅ |
member:create | ❌ | ✅ | ✅ |
member:update | ❌ | ✅ | ✅ |
member:delete | ❌ | ❌ | ✅ |
invitation:read | ❌ | ✅ | ✅ |
invitation:create | ❌ | ✅ | ✅ |
invitation:update | ❌ | ❌ | ✅ |
invitation:delete | ❌ | ✅ | ✅ |
organization:update | ❌ | ❌ | ✅ |
organization:delete | ❌ | ❌ | ✅ |
Checking permissions in code
UseauthClient.organization.hasPermission to check whether the current user holds a given permission. The method returns a data object with a success boolean.
Permission checks in UI components are for user experience only. Always enforce permissions server-side in your server functions. Client-side checks can be bypassed.
Adding a new permission resource
When your application needs a resource that does not exist in the default permission set — for example, a billing page — follow these three steps. Step 1 — Register the resource and its actions inlib/auth.ts:
ac.newRole:
