// the find
mikespook/gorbac
goRBAC provides a lightweight role-based access control (RBAC) implementation in Golang.
goRBAC is a minimal in-memory RBAC library for Go that covers the standard roles-permissions-inheritance model. It uses generics (Go 1.18+) so you can key roles and permissions with strings, integers, or custom structs. It's for applications that need simple role checks without pulling in a policy engine.
Generics support is done cleanly — switching from string to integer role IDs is a one-line change. Role inheritance with cycle detection (InherCircle) is built in, which most toy RBAC libs skip. The assertion function hook on IsGranted lets you inject runtime context (e.g. ownership checks) without the library needing to know your data model. The codebase is small enough to read in an afternoon.
Persistence is explicitly not included — the linked blog post from 2017 is the answer, which means serialization is your problem. Everything lives in-memory behind a single mutex, so this doesn't scale horizontally without you adding a sync layer. There's no concept of deny rules or permission wildcards, so anything beyond flat allow-lists requires wrapping the library. The Travis CI badge points to a dead service and the repo structure now includes LLM_CODER_GUIDE.md and PROMPTS.md, which suggests recent changes were AI-assisted rather than organically developed.