Skip to content

docs: define the static authorization schema - #421

Merged
mariajgrimaldi merged 9 commits into
mainfrom
MJG/authz-schema/configuration
Sep 16, 2026
Merged

mariajgrimaldi merged 9 commits into
mainfrom
MJG/authz-schema/configuration

Conversation

@mariajgrimaldi

@mariajgrimaldi mariajgrimaldi commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

Static roles, permissions, and their display information are currently spread across Python, Casbin policy files, and frontend code. As a result, an application that adds a role or permission must update several representations and may also need changes in openedx-authz and the frontend.

This ADR defines one versioned YAML schema for static authorization definitions. Applications can declare permissions, categories, roles, role extensions, scopes, and UI metadata with stable identifiers, while deployment compiles those definitions into the rows Casbin needs.

Merge checklist:
Check off if complete or not applicable:

  • 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

@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 Aug 27, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @mariajgrimaldi!

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.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Aug 27, 2026
@mariajgrimaldi mariajgrimaldi linked an issue Aug 27, 2026 that may be closed by this pull request
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Aug 27, 2026

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

Looking good, just added a couple of points for discussion. Thanks!

Comment thread docs/decisions/0017-static-authorization-schema.rst
Comment thread docs/decisions/0017-static-authorization-schema.rst
Comment thread docs/decisions/0017-static-authorization-schema.rst Outdated
Comment thread docs/decisions/0017-static-authorization-schema.rst Outdated

@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 for this @mariajgrimaldi!

Comment thread docs/decisions/0017-static-authorization-schema.rst Outdated
Comment thread docs/decisions/0017-static-authorization-schema.rst
Comment thread docs/decisions/0017-static-authorization-schema.rst
Comment thread docs/decisions/0017-static-authorization-schema.rst Outdated
Comment thread docs/decisions/0017-static-authorization-schema.rst
Comment thread docs/decisions/0017-static-authorization-schema.rst
Python constants and role mappings
==================================

Definitions would remain split across backend and frontend code. Applications would also need to change ``openedx-authz`` to add definitions they own.

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.

What happens to the current role and permission definitions in the Python modules? Will we keep using them? If I want to create a new permission, do I have to add it to the YAML and the Python constants file? Or will we do something different?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We'd need to entirely migrate to a configuration file to avoid having definitions scattered across multiple places

@mariajgrimaldi mariajgrimaldi Sep 1, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I made some changes: 917b782

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 agree that we should proceed with the migration.

However, by removing the Python files containing the roles and permissions constants, we wouldn't have a way to import a specific permission from another application. For example, in openedx-platform we currently do:

from openedx_authz.constants.permissions import COURSES_VIEW_COURSE

We would need to find a way to solve this without having to update openedx-authz for every new permission created via an extension. What do you think?

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.

Ideally, the roles and permissions definitions would be defined in the module that uses them, in that case, the courses permissions should be moved out of openedx-authz and into the relevant module in openedx-platform, then, the owner module would define constants within itself.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like that, @rodmgwgu! Much simpler of what I was thinking of turning permissions from .yml definition files into constants during runtime andi injecting them somewhere so they become available

@mariajgrimaldi
mariajgrimaldi force-pushed the MJG/authz-schema/configuration branch from be47fea to ff64cae Compare September 1, 2026 16:03
@mariajgrimaldi
mariajgrimaldi force-pushed the MJG/authz-schema/configuration branch 2 times, most recently from 2991a56 to 89c313d Compare September 4, 2026 12:08
Comment thread docs/decisions/0017-static-authorization-schema.rst Outdated
Comment thread docs/decisions/0017-static-authorization-schema.rst
Base automatically changed from MJG/authz-schema/static-dynamic-roles to main September 14, 2026 12:30
@mariajgrimaldi
mariajgrimaldi force-pushed the MJG/authz-schema/configuration branch 2 times, most recently from f84c026 to 85ff528 Compare September 14, 2026 12:46
@mariajgrimaldi
mariajgrimaldi force-pushed the MJG/authz-schema/configuration branch from 85ff528 to 9e69aa2 Compare September 14, 2026 12:47

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

Looks good, thanks!

@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 for the hard work! LGTM

@mariajgrimaldi
mariajgrimaldi merged commit d4c4e1b into main Sep 16, 2026
8 checks passed
@mariajgrimaldi
mariajgrimaldi deleted the MJG/authz-schema/configuration branch September 16, 2026 12:50
@github-project-automation github-project-automation Bot moved this from Waiting on Author to Done in Contributions Sep 16, 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). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Role and permission definition ADR

5 participants