惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
WordPress大学
WordPress大学
博客园_首页
大猫的无限游戏
大猫的无限游戏
Jina AI
Jina AI
The Cloudflare Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tenable Blog
Google Online Security Blog
Google Online Security Blog
PCI Perspectives
PCI Perspectives
博客园 - 三生石上(FineUI控件)
Recent Commits to openclaw:main
Recent Commits to openclaw:main
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Forbes - Security
Forbes - Security
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Security Latest
Security Latest
小众软件
小众软件
T
The Exploit Database - CXSecurity.com
C
Cisco Blogs
量子位
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
C
Cyber Attacks, Cyber Crime and Cyber Security
Scott Helme
Scott Helme
Cisco Talos Blog
Cisco Talos Blog
S
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Vulnerabilities – Threatpost
N
News and Events Feed by Topic
U
Unit 42
腾讯CDC
博客园 - 聂微东
博客园 - 【当耐特】
B
Blog
P
Proofpoint News Feed
B
Blog RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Production RBAC patterns for Go and Node startups
kensaadi · 2026-06-17 · via DEV Community

A founder told me last year:

"We need admin features shipped by Friday. Can we just hardcode the roles for now?"

That was 7 months ago. They're still paying for that decision today.

This article is the breakdown I wish I had given them before that Friday — the patterns that separate a quick MVP version of RBAC from one that won't bite you back in six months.

If you're a startup CTO, technical founder, or senior engineer about to ship admin/dashboard features for the first time, this is for you.

The 4 signs your RBAC is a time bomb

I've reviewed this exact pattern in 5+ early-stage codebases. Every one of them eventually hit the wall. Look for these signs:

1. Roles hardcoded in the JWT

{
  "sub": "user_123",
  "role": "admin"
}

Simple. Until you need to:

  • Add a new role → migration + token refresh strategy
  • Give one user a temporary elevated permission → "we'll just reissue tokens"
  • Audit who had admin last month → good luck

2. Permission checks scattered across 40+ controllers

// In every single handler:
if user.Role != "admin" {
    return c.Status(403).JSON(...)
}

By the time you have 30 endpoints, you've made the same mistake 30 times. Refactoring is a full sprint.

3. One admin superuser that can do everything

Until a sales rep accidentally deletes a customer record because they were elevated to admin "just for that one task last week."

4. Zero audit trail

When the data goes missing, your only investigative tool is git blame on the source code and a desperate grep through CloudWatch logs.

If you've nodded at any of these — keep reading.

The real problem: policies-as-code

Most teams treat permissions like business logic. They live in source files, gated by if statements, deployed with the rest of the code.

This is the original sin.

Code changes need deploys. Permissions change daily.

When marketing onboards a new role next quarter, when a customer success rep needs view-only access to billing, when legal asks "who could have read this customer's data on Tuesday at 3pm?" — every one of these requires a permission change. If permissions live in code, every one of these requires a deploy.

Production RBAC starts with one shift in mental model: permissions are data, not code.

Three rules for production-grade RBAC

Rule 1: Policy-as-data, not policy-as-code

Policies live in your database. Source code only knows how to check them, not define them.

A reasonable schema (Postgres flavor, equivalent in MongoDB):

-- Roles
CREATE TABLE roles (
  id         SERIAL PRIMARY KEY,
  name       TEXT UNIQUE NOT NULL,
  created_at TIMESTAMPTZ DEFAULT now()
);

-- Permissions (action on resource)
CREATE TABLE permissions (
  id         SERIAL PRIMARY KEY,
  resource   TEXT NOT NULL,   -- e.g., "orders", "customers"
  action     TEXT NOT NULL,   -- e.g., "read", "delete"
  UNIQUE (resource, action)
);

-- Role <-> Permission mapping
CREATE TABLE role_permissions (
  role_id        INTEGER REFERENCES roles(id),
  permission_id  INTEGER REFERENCES permissions(id),
  PRIMARY KEY (role_id, permission_id)
);

-- User <-> Role mapping
CREATE TABLE user_roles (
  user_id  INTEGER REFERENCES users(id),
  role_id  INTEGER REFERENCES roles(id),
  PRIMARY KEY (user_id, role_id)
);

In MongoDB the same idea is one document per role:

{
  "_id": "sales",
  "permissions": [
    { "resource": "customers", "action": "read" },
    { "resource": "orders",    "action": "read" },
    { "resource": "orders",    "action": "create" }
  ],
  "updatedAt": "2026-06-10T14:00:00Z"
}

The difference: now you change a permission with UPDATE, not with git push.

Rule 2: Granular permissions (action-level, not role-level)

The wrong abstraction is role === permission. The right abstraction is permission === (resource, action).

Bad:

if user.Role == "admin" { /* do everything */ }

Good:

if user.Can("orders", "delete") { /* delete the order */ }

The Can() function looks up: does this user, through any of their roles, have the permission (orders, delete)? Cache it per-request with the user's permission set loaded once on auth.

This means:

  • New permission? Insert one row. No deploy.
  • Promote a role? Add a row to role_permissions. No deploy.
  • Demote a user? Remove a row from user_roles. No deploy.

Rule 3: Audit trail — non-negotiable

Every sensitive action logs to an append-only table:

CREATE TABLE audit_log (
  id         BIGSERIAL PRIMARY KEY,
  actor_id   INTEGER REFERENCES users(id),
  action     TEXT NOT NULL,              -- e.g., "order.delete"
  resource   TEXT NOT NULL,              -- e.g., "orders/42"
  before     JSONB,                      -- snapshot before
  after      JSONB,                      -- snapshot after (NULL for delete)
  ip_address INET,
  user_agent TEXT,
  created_at TIMESTAMPTZ DEFAULT now()
);

Append-only. No UPDATE, no DELETE. When the customer record disappears, you have a complete trail of who, when, and what changed.

This sounds like overhead until the first time you need it. Then it's the cheapest insurance you ever bought.

RBAC vs ABAC vs ReBAC: which one do you need?

A quick decision tree:

Plain RBAC — most startups need this and nothing more.

  • Users have roles. Roles have permissions. Done.

ABAC (Attribute-Based Access Control) — only if your access depends on attributes of the request, not just the user.

  • "Sales reps can only see customers in their region"
  • "This document is editable only during business hours"
  • ABAC adds policy engines and complexity. Skip unless required.

ReBAC (Relationship-Based, Zanzibar-style) — only for sharing/multi-tenant graphs.

  • "User A shared this document with User B who shared a folder with Team C"
  • Google Docs, Notion, Figma need this. Your B2B SaaS probably doesn't.

If you're not sure — start with RBAC + audit log. You can always layer ABAC on top later.

A concrete implementation walkthrough

Here's the minimal viable production-grade RBAC in real code.

Go middleware (Fiber)

package middleware

import (
    "github.com/gofiber/fiber/v2"
)

type PermissionChecker interface {
    Can(userID int, resource, action string) (bool, error)
}

func RequirePermission(checker PermissionChecker, resource, action string) fiber.Handler {
    return func(c *fiber.Ctx) error {
        userID := c.Locals("user_id").(int)

        allowed, err := checker.Can(userID, resource, action)
        if err != nil {
            return c.Status(500).JSON(fiber.Map{"error": "permission check failed"})
        }
        if !allowed {
            return c.Status(403).JSON(fiber.Map{"error": "forbidden"})
        }
        return c.Next()
    }
}

// Usage in routes:
// app.Delete("/orders/:id",
//     RequirePermission(permChecker, "orders", "delete"),
//     handlers.DeleteOrder)

The middleware is stateless about which roles exist. It just asks: "can this user do this action on this resource?" The answer comes from the DB.

Node middleware (Express)

// middleware/requirePermission.js
function requirePermission(checker, resource, action) {
  return async (req, res, next) => {
    try {
      const allowed = await checker.can(req.user.id, resource, action);
      if (!allowed) {
        return res.status(403).json({ error: 'forbidden' });
      }
      next();
    } catch (err) {
      return res.status(500).json({ error: 'permission check failed' });
    }
  };
}

module.exports = requirePermission;

// Usage:
// router.delete('/orders/:id',
//   requirePermission(permChecker, 'orders', 'delete'),
//   handlers.deleteOrder);

Same pattern, different language. The permission set is loaded once at login and cached on the user session — checker.can() is an in-memory lookup against a Set per request.

Frontend gating: where most teams stop too early

Most articles end here with a one-component <Can> example and a "server-side check is the source of truth" disclaimer. That's correct, but it's the bare minimum of what production RBAC needs on the frontend.

A real RBAC layer on the frontend has at least 5 concerns:

  1. Hook-level access — read user permissions anywhere without prop drilling
  2. Inline gating — show/hide buttons, columns, table actions
  3. Route-level gating — block entire pages, redirect unauthorized users
  4. Admin UI — non-engineers need to view/edit roles and permissions
  5. Audit visibility — someone needs to read the audit log without DB access

Skip any of these and you'll re-invent them six months later. Here's the shape they should have.

1. The hook

// useAuth() returns user + a Set of permission keys
const { user, permissions } = useAuth();

// usePermissions() is a focused alias when you don't need user data
const permissions = usePermissions();

permissions.has('orders:delete');  // true | false
permissions.canAny(['orders:delete', 'orders:archive']);
permissions.canAll(['customers:read', 'customers:update']);

The permission set is loaded once on auth, cached in React context, and every check is O(1).

2. Inline gating with <Can>

<Can resource="orders" action="delete">
  <DeleteButton onClick={handleDelete} />
</Can>

// With a fallback (shows a disabled button + tooltip instead of hiding)
<Can
  resource="orders"
  action="delete"
  fallback={<DisabledButton tooltip="You don't have permission to delete orders" />}
>
  <DeleteButton onClick={handleDelete} />
</Can>

// With multiple permissions (any of these is enough)
<Can anyOf={["orders:delete", "orders:archive"]}>
  <DangerActions />
</Can>

The fallback prop is the key detail most implementations miss. Hiding a button creates a worse UX than showing it disabled with a "why you can't" tooltip — users feel less broken when they know the rule exists.

3. Route-level gating with <RoleGuard>

// Inside the router
<Route
  path="/admin/orders"
  element={
    <RoleGuard
      anyOf={["orders:read"]}
      fallback={<ForbiddenPage />}
      redirect="/dashboard"
    >
      <OrderManagementPage />
    </RoleGuard>
  }
/>

Whole pages refuse to render. Better than letting the user load the page and then erroring on every API call.

4. The admin UI — the part nobody writes themselves

This is where DIY RBAC implementations fall apart. Engineers build the middleware and the hook and stop. Then someone in product asks: "Can sales also export customers?" and the answer is: "Sure, I'll deploy that change next week."

A real admin UI lets non-engineers:

  • See the role × permission matrix (the same diagram everyone draws on a whiteboard)
  • Toggle permissions per role with a click
  • Assign users to roles
  • See the audit log filterable by actor, action, date range, IP

This is what an <PermissionMatrix> admin component looks like from the consumer side:

<PermissionMatrix
  roles={roles}                  // ["customer", "sales", "admin"]
  resources={resources}          // ["orders", "customers", "products"]
  actions={["read", "create", "update", "delete"]}
  value={currentPolicy}          // current role × permission map
  onChange={handlePolicyChange}  // saves to DB, no deploy
  readonly={!permissions.has('admin:manage_roles')}
/>

Behind it: the same roles / permissions / role_permissions tables from Rule #1. Edits hit the DB directly. No code change, no deploy, no engineer in the loop.

5. The audit log viewer

<AuditLogViewer
  filters={{
    actor: userId,
    actionPrefix: "order.",       // "order.delete", "order.update", etc.
    dateRange: last30Days
  }}
  columns={["actor", "action", "resource", "before", "after", "ip"]}
  exportable                     // CSV export for compliance reviews
  paginate
/>

When the data goes missing or the auditor asks who did what, you don't psql into prod. You filter the UI.

Audit logging in two lines

Wrap your mutation handlers with a logger:

func DeleteOrder(c *fiber.Ctx) error {
    orderID := c.Params("id")
    order, _ := db.GetOrder(orderID)

    if err := db.DeleteOrder(orderID); err != nil {
        return err
    }

    audit.Log(c.Locals("user_id").(int), "order.delete",
        "orders/"+orderID, order, nil, c.IP(), c.Get("User-Agent"))

    return c.SendStatus(204)
}

Same pattern in Node. The audit log table is append-only. Months from now, when something disappears, you'll have the full trail.

The RBAC layer in Dashforge — what end-to-end actually looks like

Everything above — the schema, the middleware, the hooks, the components, the admin UI — is the actual design of the RBAC layer in Dashforge.

The reason this article exists is that every piece of this puzzle is usually built separately by separate teams, in different shapes, with different bugs. The middleware is in one repo, the React <Can> is invented case-by-case, the audit log is "TODO for next sprint", the admin panel never gets built. Six months later you have four half-finished RBAC systems that don't talk to each other.

Dashforge ships them as one coherent layer:

The full stack, day-1 ready

┌──────────────────────────────────────────────────────────────────┐
│  Admin UI (React)                                                 │
│  ── PermissionMatrix   roles × actions toggle grid                │
│  ── UserRolesEditor    assign/revoke roles per user               │
│  ── AuditLogViewer     filter, search, CSV export                 │
└─────────────────┬────────────────────────────────────────────────┘
                  │ same auth context, same permission set
┌─────────────────▼────────────────────────────────────────────────┐
│  React components                                                 │
│  ── useAuth()  /  usePermissions()  /  <Can>  /  <RoleGuard>      │
│  Available in BOTH Tailwind and MUI flavors                       │
└─────────────────┬────────────────────────────────────────────────┘
                  │ HTTP, JWT carries user_id only
┌─────────────────▼────────────────────────────────────────────────┐
│  Backend middleware                                               │
│  ── Go (Fiber) and Node (Express) — same contract                 │
│  ── RequirePermission(resource, action)                           │
│  ── Audit log middleware (auto-wraps mutations)                   │
└─────────────────┬────────────────────────────────────────────────┘
                  │
┌─────────────────▼────────────────────────────────────────────────┐
│  Database (MongoDB, Postgres-ready via provider pattern)          │
│  ── roles, permissions, role_permissions, user_roles, audit_log   │
└──────────────────────────────────────────────────────────────────┘

Single source of truth — the database. Every layer reads from the same tables. You change a permission once, the change propagates automatically:

  • Middleware blocks unauthorized requests
  • React <Can> hides UI accordingly
  • Audit log records everything
  • Admin panel reflects the new state

No code changes anywhere. No deploy.

What you get on day 1

When you open the checkout-kit, the RBAC layer is already wired up with three working roles and the full admin UI:

Backend (Go or Node — pick one):

  • RequirePermission(resource, action) middleware wrapping every protected route
  • PolicyChecker service that loads user permissions on auth, caches them per session
  • Audit logger that wraps mutation handlers automatically (no per-handler boilerplate)
  • REST endpoints for /admin/roles, /admin/permissions, /admin/users/:id/roles, /admin/audit-log

Frontend (Tailwind OR MUI flavor — both shipped):

  • <AuthProvider> initialized in your root component
  • useAuth() and usePermissions() hooks ready to import
  • <Can> with fallback, anyOf, allOf props — the full API documented above
  • <RoleGuard> for route-level protection (drop-in for React Router)
  • <PermissionMatrix> admin component — pre-styled, pre-wired to the API
  • <UserRolesEditor> — searchable user list with role assignment
  • <AuditLogViewer> — filterable, exportable, paginated

Three roles, pre-seeded:

  • customer — read their own orders, update their own profile
  • sales — read/create/update orders and customers, no delete
  • admin — everything, plus role/permission management

Extending to a fourth role is one row in the roles table and a few clicks in the admin UI. No code change required.

Why bundling matters

You can build all of this yourself. Here's the realistic timeline I've seen in startups:

Component Time to build properly (mid-senior engineer)
DB schema + migrations 4-6 hours
Middleware Go + Node 6-10 hours
React hooks + Context 4-6 hours
<Can> + <RoleGuard> with edge cases 6-10 hours
<PermissionMatrix> admin UI 16-24 hours
<UserRolesEditor> with search/pagination 8-16 hours
<AuditLogViewer> with filters/export 12-20 hours
Audit middleware + before/after snapshot logic 8-12 hours
End-to-end tests, documentation, bugfixes 16-24 hours
Total realistic 80-130 hours (2-3 weeks)

That's not counting design iterations, the inevitable "wait, we forgot about row-level permissions" mid-sprint, or onboarding a new engineer who needs to understand all of it.

Dashforge ships it all on day 1, in your repo, code you own. You modify it freely. There's no SaaS subscription, no vendor lock-in, no monthly fee. Buy it once, deploy it forever.

How it composes with the rest of the kit

The checkout-kit isn't just RBAC. The same auth + permission layer also powers:

  • Stripe checkout flow — pricing tiers gated by role (admin sees test-mode toggles, customer sees buy CTAs only)
  • Product catalog — sales can create products, customer can only browse
  • Order management — full CRUD for admin/sales, read-only for customer
  • Multi-tenant ready — extend the policy with a tenant_id column and you have row-level security
  • Stripe webhook handlers — already protected with API-key auth, audit logged

The whole thing is one repo, one auth model, one permission set. Not five disconnected libraries glued together with hope.

If you're about to start building this from scratch — pause and take a look at the kit. You'll save 2-3 weeks of work and get a layer that's already been thought through. Drop a comment if you want me to share more on a specific piece (the schema migrations, the audit log middleware, the admin UI patterns).

Your turn

If you've shipped RBAC in production recently, I'd love to hear what tradeoffs you made:

  • Did you build from scratch, or use a library (Casbin, Oso, Permify)?
  • ABAC, ReBAC, or plain RBAC + audit?
  • What's the one thing you'd do differently?

Drop a comment — I'm collecting patterns for a follow-up piece on RBAC at scale (10K+ users, multi-tenant).


If you found this useful and want more deep-dives on Go/Node infrastructure patterns for startups, follow me here on dev.to.