DEV Community

Cover image for Enterprise-Grade Access Control for Python Apps - Battle-Tested & Open Source
Maneesh Thakur
Maneesh Thakur

Posted on

Enterprise-Grade Access Control for Python Apps - Battle-Tested & Open Source

We built a Zero-Dependency RBAC Library for Python - Need Your Feedback!

๐ŸŽฏ Quick Summary

Ever needed proper access control in your app but didn't want to:

  • Roll your own buggy permission system?
  • Pull in a heavyweight framework with 47 dependencies?
  • Just if user.is_admin: everywhere and pray?

We built
RBAC Algorithm - a lightweight, production-ready access control library for Python.

Quick example:

from rbac import RBAC, User, Permission

rbac = RBAC()
user = User("alice", roles=["editor"])

if rbac.check_permission(user, Permission("write", "document")):
    save_document(data)  # โœ… Editor can write
Enter fullscreen mode Exit fullscreen mode

That's it. No config files, no database, no complexity.
We have also created a test-app integrated with streamlit UI to validate the features. test-app is available in the same repo.


โœจ Key Features

  • ๐ŸŽฏ Role Hierarchies - Roles inherit from parent roles (DRY permissions)
  • ๐Ÿข Multi-Tenant Ready - Domain isolation out of the box
  • ๐ŸŽจ ABAC Support - Attribute-based rules (context-aware permissions)
  • โšก Fast - 10K+ authorization checks per second
  • ๐Ÿ“ฆ Zero Dependencies - Pure Python, production-safe
  • ๐Ÿงช Battle-Tested - 95%+ test coverage, 1,500+ property-based tests
  • ๐Ÿ”’ Security Scanned - Dual scanning (Safety + pip-audit) in CI
  • ๐Ÿค– AI-Ready - Perfect for securing AI agents and assistants

๐Ÿ”— Try It Out

Quick install:

pip install git+https://github.com/Maneesh-Relanto/RBAC-algorithm
Enter fullscreen mode Exit fullscreen mode

๐Ÿ™‹ Please share your feedback on the features built so far and also:

We are planning the next features. Which would YOU find most useful?

Option A: Flask Integration

Option B: FastAPI Integration

Option C: Storage Adapters

What would make this production-ready for YOUR project?

Appreciate you reading through.
Thanks.

Top comments (0)