Skip to content

Commit cb10b9a

Browse files
[FC-0099] feat: add public API to interact with roles and permissions (#75)
Introduce the public Python APIs for Open edX AuthZ. These modules expose role, permission, and user-assignment operations as an abstraction on top of the Casbin engine. The design follows a bottom-up approach: a type-safe data layer, low-level APIs for roles and permissions, and a user-facing convenience API (user-assignment).
1 parent b7ec992 commit cb10b9a

36 files changed

+4445
-272
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ docs/openedx_authz.*.rst
6464
requirements/private.in
6565
requirements/private.txt
6666

67-
# Sqlite Database
67+
# Persistent database files
68+
*.sqlite3
6869
*.db

CHANGELOG.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@ Unreleased
2222
Added
2323
=====
2424

25-
* First release on PyPI.
25+
* Basic repo structure and initial setup.
26+
27+
0.2.0 - 2025-10-10
28+
******************
29+
30+
Added
31+
=====
32+
33+
* ADRs for key design decisions.
34+
* Casbin model (CONF) and engine layer for authorization.
35+
* Implementation of public API for roles and permissions management.

docs/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ def get_version(*file_paths):
4747
# If extensions (or modules to document with autodoc) are in another directory,
4848
# add these directories to sys.path here. If the directory is relative to the
4949
# documentation root, use os.path.abspath to make it absolute, like shown here.
50-
#
50+
51+
autodoc_mock_imports = [
52+
"openedx_authz.api",
53+
]
54+
5155
# import os
5256
# import sys
5357
# sys.path.insert(0, os.path.abspath('.'))
@@ -72,6 +76,7 @@ def get_version(*file_paths):
7276
# A list of warning types to suppress arbitrary warning messages.
7377
suppress_warnings = [
7478
"image.nonlocal_uri",
79+
"autodoc.mocked_object"
7580
]
7681

7782
# Add any paths that contain templates here, relative to this directory.

openedx_authz/api/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Public API for the Open edX AuthZ framework.
2+
3+
This module provides a public API as part of the Open edX AuthZ framework. This
4+
is part of the Open edX Layer used to abstract the authorization engine and
5+
provide a simpler interface for other services in the Open edX ecosystem.
6+
"""
7+
8+
from openedx_authz.api.data import *
9+
from openedx_authz.api.permissions import *
10+
from openedx_authz.api.roles import *
11+
from openedx_authz.api.users import *

0 commit comments

Comments
 (0)