docs: define the static authorization schema - #421
Conversation
|
Thanks for the pull request, @mariajgrimaldi! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
rodmgwgu
left a comment
There was a problem hiding this comment.
Looking good, just added a couple of points for discussion. Thanks!
BryanttV
left a comment
There was a problem hiding this comment.
Thanks for this @mariajgrimaldi!
| 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
We'd need to entirely migrate to a configuration file to avoid having definitions scattered across multiple places
There was a problem hiding this comment.
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_COURSEWe 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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
be47fea to
ff64cae
Compare
2991a56 to
89c313d
Compare
f84c026 to
85ff528
Compare
85ff528 to
9e69aa2
Compare
BryanttV
left a comment
There was a problem hiding this comment.
Thanks for the hard work! LGTM
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-authzand 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: