060104 better auth rbac
Role-based access control with Better Auth — permission statements, createAccessControl, authorize() checks, dual auth, and frontend permission sync.From its SKILL.md
npx -y skills add natuleadan/skills --skill 060104-better-auth-rbacAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
1.1 KB, 202 tokens by cl100k_base, as published. Nobody here has run it
Better Auth RBAC
When to use
When implementing granular role-based permissions beyond Better Auth's built-in admin plugin roles.
References
| Topic | File |
|---|---|
| Permission statements | references/permission-statements.md |
| Role definitions | references/role-definitions.md |
| Dual auth (API key + session) | references/dual-auth.md |
| Frontend permissions sync | references/frontend-sync.md |
Quick checklist
- Define all permission actions in
customStatementswithas const - Create roles with
ac.newRole({})mapping statements to actions - Check permissions with
roleObj.authorize(permissions) - Admin role always passes (short-circuit before authorize)
- Use
requireApiKeyOrSession()for dual auth (Bearer or cookie) - Frontend: keep
permissions.tsin sync with backend role definitions
What ships with it: 7 files
7.1 KB alongside SKILL.md, 1 of them executable
evals/
- evals.json403 B
references/
- dual-auth.md1.1 KB
- frontend-sync.md1.0 KB
- permission-statements.md1.1 KB
- role-definitions.md1.8 KB
scripts/
- check-permissions.pyruns1.3 KB
- metadata.json508 B