RefactKit uses a resource-action permission model built on top of 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. Every organization member has 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 checked server-side on every relevant request.
The three roles
Member
Can view the organization dashboard. Has no management access — cannot read the member list, send invitations, or change any settings.
Admin
Can manage members (except owners) and send invitations. Can view the member list and revoke invitations. Cannot delete members, transfer ownership, or delete the organization.
Owner
Full control. Can do everything an Admin can, plus delete members, update or delete the organization, and manage invitation status. Every organization must have at least one Owner.
Permission matrix
| 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 | — | — | ✅ |
How roles are assigned
When a user creates an organization, they are automatically assigned the Owner role. When a user accepts an invitation, they receive the role that was specified at invite time (Member or Admin). A user’s role can be changed later by an Admin or Owner through the organization members page.Checking permissions in your code
UseauthClient.organization.hasPermission() to check whether the current user has a specific permission before executing sensitive logic. Pass the permission string in resource:action format:
member table directly and inspect the role:
Adding a new permission resource
If your product has capabilities beyond what the built-in resources cover — for example, a billing page or an analytics section — you can extend the access control definition inlib/auth.ts:
After modifying
lib/auth.ts, run npx drizzle-kit push if your changes introduce any new database columns. Permission definitions themselves are in-memory, but if you add new Better Auth plugins alongside them, schema changes may be required.