FAQ
Plain answers about what Rolebook does, and what stays in your app.
What is Rolebook, in one sentence?
It is the part of your app that decides what each person can see or change, and tells you why when the answer is no.
Who is it for?
Teams building multi-tenant apps with workspaces, projects, and more roles than just admin and member. Developers wire it into the backend; product, support, and security teams get clear rules and readable answers.
Does Rolebook come with UI components?
The core engine has no UI of its own and runs behind the scenes. If you use Rolebook Sharing with React, @rolebook/react provides accessible MembersList, InviteMember, OwnershipTransfer, and AuditLog components (plus headless hooks) wired to your Sharing HTTP API.
I already use Better Auth, Clerk, or WorkOS. Do I still need this?
Sign-in providers tell you who someone is and which organization they belong to. Rolebook decides what they can do with a specific project, folder, or document. They work together: Rolebook includes identity adapters for Better Auth, Clerk, and WorkOS, plus a drop-in @rolebook/better-auth plugin.
Does Rolebook authenticate users?
No. Your sign-in provider handles login and sessions. Rolebook decides what a signed-in person is allowed to do.
Where are roles and memberships stored?
In your own database. The core engine stores nothing: your app passes in the user's roles on each request. If you add @rolebook/sharing, the PostgreSQL and SQLite adapters store per-item memberships, invitations, and audit logs in tables alongside your app's data.
Can my support team see why someone can't open something?
Yes, once you turn inspection on. Authorized inspectors can ask Rolebook Sharing why a user can or can't perform an action on an item right now and see the rules involved. Your rate limiter caps attempts, and Rolebook records an inspection audit event before returning an explanation.
Can Rolebook filter lists from my own database tables?
Yes, on PostgreSQL and SQLite. Register a query over your table with the filters and sort order you need, and Rolebook returns pages of item keys the user is allowed to open, checked against one consistent database snapshot.
Can I list everything one person can access?
Yes. Rolebook Sharing can page through the items a user can perform a specific action on (listAccessible), or every item they can do anything on along with each action's decision (listAccess). Each page is checked against a single snapshot of your database and identity data, and returns a clear unavailable error rather than a partial or inconsistent list.
Can a removed role slip through between a check and a database write?
A plain check before a write can go stale if access is revoked a split second later. On PostgreSQL and SQLite, protected writes close that gap by running the permission check and your SQL update inside the same transaction, committing both together with a receipt or rolling both back.
Can Rolebook notify other systems when access changes?
Yes. On PostgreSQL and SQLite, @rolebook/server/webhooks delivers committed access changes (grants, role changes, removals, ownership transfers, and invitations) as signed HTTP webhooks with retries, and @rolebook/http/webhooks verifies them.
Which languages can use Rolebook?
The core engine and sharing packages run in TypeScript and JavaScript. For other languages, the Sharing HTTP API includes Python, Go, and Rust clients (Python includes explain; Go and Rust cover the six everyday operations), and any language can call the decision service over HTTP.
Does the core engine call a database or the network?
No. The core rolebook package has zero runtime dependencies and makes no database or network calls. Storage, HTTP endpoints, webhooks, and remote or offline checks live in optional companion packages.
Should I embed the engine, call the Sharing HTTP API, or run the decision service?
Embed the engine in any TypeScript or JavaScript server: it is the fastest path and adds no network hop. Mount the Sharing HTTP API for browser code, React components, and Python, Go, or Rust clients managing shared items. Mount the decision service when other backend services need plain permission checks over HTTP. Many apps combine two or three.
Can a device check access while offline?
Yes, for checks you prepare ahead of time. Your server signs an Ed25519 bundle containing everything one check needs, and @rolebook/offline verifies the signature, expiry, and rollback state before running the same engine locally. Anything it can't verify returns a no-decision, never an allow. Offline revocation is bounded by lease updates and expiry windows, not instant.
I use Casbin today. How do I move?
@rolebook/migrate checks your Casbin role model against its supported subset, generates a Rolebook policy and assignment plan, and lets you replay checks in shadow mode while Casbin keeps enforcing. It changes nothing on its own and refuses unsupported rules with a clear reason instead of guessing.
Why use a policy instead of if-statements in my routes?
Checks like if (user.role === "admin") work until your third role, second workspace, or first audit. Putting rules in one policy keeps your routes, buttons, background jobs, and sharing screens following the same rules.
When should I use something else?
If your permissions rely on arbitrary, open-ended relationship graphs across many services, use a relationship-based (ReBAC) database instead. Rolebook is built around scoped roles, a single parent chain per item (with opt-in folder inheritance), and flat teams by default (with opt-in bounded team nesting).
Something else? Get in touch.