openedx / openedx/openedx-authz
Role-agnostic API behavior
Open
@efortish is already working on this.
Since Sep 2, 2026.
willow
- Dominant language
- Python
- Stars
- 0
- Forks
- 9
- Avg merge
- 13d 9h
- Merged PRs (30d)
- 9
Description
Description
- Audit of existing code: review the listing, validation, assignment, and filtering paths for roles, looking for:
- Comparisons like
if role == "instructor"or hardcoded lists of valid roles. - Conditional branches specific to a role name.
- Validations that assume a fixed, known set of roles at write time.
- Comparisons like
- Refactor: replace those comparisons with lookups against the dynamically loaded definitions.
- Risk to watch: this kind of hardcoding tends to be scattered across several modules (serializers, DRF permissions, form validators) — worth doing an exhaustive grep before estimating this as "done."
- Regression: current built-in roles must keep working exactly the same after the refactor — this task carries high risk of breaking existing functionality if not covered by regression tests.
Concrete deliverable: no AuthZ endpoint has code that depends on knowing a specific role name in advance; everything resolves against the loaded definitions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.