openedx / openedx/openedx-authz

Role-agnostic API behavior

Open
#414 1 comment 0 reactions 1 assignee View on GitHub

@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.
  • 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.