Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

(Parameterized Role-Based Access Control)

https://github.com/dimagi/django-prbac

Build Status Test coverage PyPi version

About RBAC and PRBAC

Role-based access control (RBAC) is the standard method for access control in large systems. With RBAC, you grant privileges to roles. For example you might grant the privilege Reporting to the role Analyst. In most systems, you can nest roles as deeply as you want, and give users however many roles. A good example of this in practice is PostgreSQL roles and privileges.

The roles and privileges are whatever abstract concepts make sense for your system. It is up to application code to determine what actions to take based on the privileges granted. You can use django-prbac to implement lower level concepts such as row-level or object-level access control.

Parameterized role-based access control (PRBAC) adds parameters to roles and privileges. Now, for example, you might grant "Reporting(organization="Dimagi",area="Finance") to FinancialAnalyst(organization="Dimagi"). If you don’t use parameters, then it is just RBAC. If you use parameters with finite sets of choice, then it is exponentially more powerful. If you use parameters with infinitely many choices (such as strings or integers) then it is infinitely more powerful. A good example of limited parameterization is how particular privileges (SELECT, UPDATE, etc) in PostgreSQL may be parameterized by an object. In PRBAC this parameterization is pervasive.

In-depth documentation

To learn more about parameterized role-based access control as implemented in this library, please visit http://django-prbac.readthedocs.org/

Access Control for Django

  • django.contrib.auth: This app, shipped with Django, provides unix-style access control (users, groups, permissions) with an extensible set of permissions that are implicitly parameterized by a content type. This is fundamentally different than role-based access control. It is only worth mentioning because it comes with Django and everyone is going to want to know “why did you reimplement the wheel?”. If django.contrib.auth is the wheel, then RBAC is the car and PRBAC is a transformer. I leave it as an exercise to the reader to attempt to implement PRBAC using django.contrib.auth :-)

  • django-rbac: This project appears defunct and is not parameterized in any rate.

  • django-role-permissions: This app implements a sort of RBAC where roles are statically defined in code.

  • Others can be perused at https://www.djangopackages.com/grids/g/perms/. Many offer object-level permissions, which is as orthogonal to role-based access control as unix permissions. In fact, this is probably true of anything using the term “permissions”.

Quick Start

To install, use pip:

$ pip install django-prbac

License

Django-prbac is distributed under the MIT license. (See the LICENSE file for details)

Release files for django-prbac 1.1.2.dev20260526180143

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-prbac 1.1.2.dev20260526180143
File Size Uploaded
django_prbac-1.1.2.dev20260526180143.tar.gz 15.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-prbac 1.1.2.dev20260526180143
File Interpreter ABI Platform
django_prbac-1.1.2.dev20260526180143-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / django_prbac-1.1.2.dev20260526180143.tar.gz

Download URL django_prbac-1.1.2.dev20260526180143.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
29fa83ca3642d855c5461ef5341c494103e1c8286e61e3c1f2bda7d91bc9a1fc
BLAKE2b-256 checksum
How to use checksums
47ffdd90e8a5607909e2fe7dc57a82945343143d987545c44d8dc081d16f392e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 26, 2026.

Transparency log

Release files / django_prbac-1.1.2.dev20260526180143-py3-none-any.whl

Download URL django_prbac-1.1.2.dev20260526180143-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3da501b6930a1c284411b5536da1dab3e47b643824ab5f21f3ff6fa07b2f823a
BLAKE2b-256 checksum
How to use checksums
8af5eaf5ca0b3323c8d4ec6fa4d8254e11f8278642b92c4953b5af5e5c098e06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 26, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page