Beyond RBAC: Building Team-Scoped Authorization in Go
Most Go tutorials teach you to slap a JWT middleware on your routes and call it "auth." But what happens when your SaaS product has accounts, teams, members with different roles, and resources that belong to specific teams? Simple role checks break down fast.
In this talk, I'll share hard-won lessons from building a production multi-tenant authorization system in Go. We'll go beyond basic RBAC into team-scoped, request-context-aware authorization — the kind you actually need when building fintech platforms, HR tools, or any B2B product where data isolation isn't optional.
I'll walk through concrete Go patterns: injecting team context via middleware so every downstream handler knows which team it's operating on, composable permission checks that don't turn into middleware spaghetti, the critical difference between userId vs accountId vs teamId scoping (and the data leaks that happen when you get it wrong), and how to make authorization decisions testable without spinning up your entire stack.
We'll also cover the "god admin" anti-pattern — why giving super-admin access to bypass all checks creates hidden bugs — and how to design permissions that degrade gracefully. Every pattern will be shown in real Go code, not pseudocode.
You'll leave with a clear architecture for multi-tenant authorization, reusable middleware patterns, and the confidence to build systems where Team A can never accidentally see Team B's data.