Skip to content

docs: add ADR for authorization schema source tracking - #444

Merged
rodmgwgu merged 3 commits into
mainfrom
rod/authz-schema-adr
Sep 17, 2026
Merged

rodmgwgu merged 3 commits into
mainfrom
rod/authz-schema-adr

Conversation

@rodmgwgu

@rodmgwgu rodmgwgu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Problem

The authorization schema loading pipeline needs a documented decision record explaining how schema definitions and their source are tracked before the implementation lands.

Approach

Adds ADR 0025-authorization-schema-source-tracking.rst describing the source-tracking design.

AI Usage

Kiro was used to assist on research and write the ADR with human guidance and validation.


Stack (1/3) — split from a single combined commit for reviewability:

  1. This PR — ADR doc (base: main)
  2. rod/authz-schema-files — authz schema YAML files (base: this branch)
  3. rod/authz-schema-loader — schema loading pipeline (base: PR 2)

Merge checklist:

  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

Adds 0025 ADR describing how authorization schema definitions and
their source are tracked. Part 1 of the schema loading pipeline stack.
@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Sep 10, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @rodmgwgu!

This repository is currently maintained by @openedx/committers-openedx-authz.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@BryanttV BryanttV left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have a few questions.

Comment thread docs/decisions/0025-authorization-schema-source-tracking.rst
Comment thread docs/decisions/0025-authorization-schema-source-tracking.rst
Comment thread docs/decisions/0025-authorization-schema-source-tracking.rst Outdated
Comment on lines +48 to +53
* a permission-category table (stable id and display fields);
* a permission-definition table (namespace and name forming the complete permission id, plus
display fields, category, and supported scopes);
* a role-definition table (stable role id, display fields, supported scopes, and the ``hidden``
flag from `ADR 0023`_); and
* a role-permission table holding one row per ``(role, permission, scope)`` relationship.

@mariajgrimaldi mariajgrimaldi Sep 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include how each of these tables will be used? I think the storage approach for both dynamic and static rules should be covered in a separate ADR. Also that ADR should also explain how these tables relate to ExtendedCasbinRule and its current fields. I think it'd be a good continuation of: #422 (store, however we want to call the lifecycle phase)

What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally, I thought on using ExtendedCasbinRule for tracking this, however decided on not using it because it is more geared towards assignments (g rules), and is one-to-one related to the corresponding CasbinRule, while we could have more than one contributing source for a single role or permission.

Also to avoid confusions and keep concerns separated.

Comment thread docs/decisions/0025-authorization-schema-source-tracking.rst Outdated
Comment thread docs/decisions/0025-authorization-schema-source-tracking.rst Outdated
Comment on lines +81 to +82
Because attribution lives at the role-permission grain, a core grant and a module-added grant on
the same role remain individually attributed. For ``course_admin``:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we should shared vocabulary for this. Maybe we can call the built-in roles built-in (come with deployment) and user-defined those added by extensions, or any other alternative

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, this is confusing, on other ADRs we were talking about static vs dynamic right? I think we can keep those, I'll update the text to reflect that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm after reading it again, the actual distinction we want here is the "roles that come with Open edX" vs "roles added by another module or plugin", however, technically there shouldn't be any difference between roles that come with Open edX and the ones added by a module, as we will be using the same mechanism to register them anyways.

I'l revise this text to make this clearer.

@mariajgrimaldi mariajgrimaldi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes total sense to me! Excited to see what comes out of this :)

I think we could consider this ADR as done, if we need any changes then we can implement them retroactively. One note though, this ADR defines two things: storage of these definitions after compilation and the derivability of sources, not sure if it'd be better to split them. I'll let it up to you to decide!

@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Sep 17, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Sep 17, 2026
@rodmgwgu
rodmgwgu merged commit 8e500d7 into main Sep 17, 2026
8 checks passed
@rodmgwgu
rodmgwgu deleted the rod/authz-schema-adr branch September 17, 2026 15:30
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Policy contribution attribution

5 participants