Registry / auth-security / edx-rbac

edx-rbac

JSON →
library3.0.0pypypiunverified

Library for managing role-based access control (RBAC) for Django applications, used within the Open edX ecosystem. Current version: 3.0.0 (2025). Release cadence: sporadic, with minor and patch releases every few months.

pip install edx-rbac
INSTALL
IMPORT
SIG · EDX-RBAC
E
edx-rbac
auth-securitypythonv3.0.0
Install
7.8s avg
Import
Disk
115MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 109MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 7.8s · import 0.000s · 111MB
115MB installed
● package 115MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RoleAssignment
from edx_rbac.models import RoleAssignment
from edx_rbac.models import RoleAssignment

Create a user, assign a role, and verify role existence.

from django.contrib.auth.models import User from edx_rbac.models import RoleAssignment from edx_rbac.utils import user_has_role # Create a user and assign a role user = User.objects.create_user('testuser', 'test@example.com', 'password') RoleAssignment.objects.create(user=user, role='admin', context='default') # Check if user has a role has_role = user_has_role(user, 'admin') print(f'User has admin role: {has_role}')
Debug
Known issues
breakingVersion 3.0.0 drops Python 3.11 support. Upgrade to Python 3.12+.
fix
Upgrade Python to 3.12 or later, then pin edx-rbac>=3.0.0.
affects: <3.0.0
breakingVersion 2.0.0 drops Python 3.8 support.
fix
Upgrade Python to 3.9+.
affects: <2.0.0
gotchaDo not import from edx_rbac.helpers; that module is deprecated and will be removed. Use edx_rbac.utils instead.
fix
Change imports to edx_rbac.utils.
affects: >=1.0.0
gotchaThe default RoleAssignment model requires a valid `context` field; using an empty string may cause unexpected behavior.
fix
Always provide a meaningful context when creating RoleAssignment objects.
affects: all
Upgrade
Version history
3.0.0latest on PyPI · released Mar 13, 2026
Audit
Dependencies
djangorequiredCore dependency for Django integration
PyJWTrequiredUsed for JWT token decoding in role verification
edx-django-utilsrequiredCommon utilities for Open edX Django apps
Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources