@flowlib/rbac
v0.0.7
Published
RBAC plugin for Flowlib — adds role-based access control UI, flow sharing, and permission management. Requires @flowlib/user-auth.
Readme
Adds flow-level permissions, sharing UI, and access control enforcement to Flowlib. Requires @flowlib/user-auth for session resolution.
Install
pnpm add @flowlib/rbacBackend
import { auth } from '@flowlib/user-auth';
import { rbac } from '@flowlib/rbac';
const flowlibRouter = await createFlowlibRouter({
database: { type: 'sqlite', connectionString: 'file:./dev.db' },
encryptionKey: process.env.FLOWLIB_ENCRYPTION_KEY,
plugins: [
auth({ globalAdmins: [{ email: '[email protected]', pw: 'secret' }] }), // Must come first
rbac(),
],
});
app.use('/flowlib', flowlibRouter);Frontend
import { Flowlib } from '@flowlib/ui';
import { rbacFrontend } from '@flowlib/rbac/ui';
<Flowlib apiBaseUrl="http://localhost:3000/flowlib" plugins={[rbacFrontend]} />;The plugin contributes sidebar items, an access management page, a flow-level access panel tab, and a share button in the flow editor header.
Exports
| Entry Point | Content |
| --------------------- | ------------------------------------------------------------------------------------- |
| @flowlib/rbac | Backend plugin (Node.js) |
| @flowlib/rbac/ui | Frontend plugin — rbacFrontend, RbacProvider, ShareFlowModal, FlowAccessPanel |
| @flowlib/rbac/types | Shared types — FlowAccessRecord, FlowAccessPermission, etc. |
