Role-based access control in Django - How we forked Guardian
summary
A fork of Guardian called AK-Guardian fork implements role-based authorization for Django by adding roles, a group hierarchy with cached descendant sets, just-in-time privilege grants, delegated permissions, and moving custom permissions into the database; Django’s model backend is effectively disabled for authorization and replaced by a unified SQL path that joins user→role/group→role-object-permission→permission. The implementation produces a single complex query, benchmarks with 10,000 groups benchmark show very fast results, and the new role object permission model is actively used in production.
AI-written summary · about
