Repository navigation
refactor: organize built-in definitions into applets - #550
mariajgrimaldi wants to merge 11 commits into
Conversation
ccec94b to
878dc00
Compare
|
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. |
ead2ce3 to
37a2fc2
Compare
930be25 to
3eeea40
Compare
6c5d32e to
2f2d4bd
Compare
5707c55 to
ca94c77
Compare
ca94c77 to
f98fc94
Compare
55d4580 to
984a676
Compare
984a676 to
0ff04f4
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0ff04f4 to
64d001b
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
64d001b to
75f0637
Compare
Description
This PR applies ADR 0032 and ADR 0033 to the existing built-in definitions, which currently share four YAML files and two constant modules, so each definition moves to the applet that owns it without changing the compiled schema:
content_librariesowns the library roles and permissions;course_authoringowns the course permissions and adds them to the course-team roles throughrole_extensions;course_team_rolesdefines the course-team roles together with the legacy compatibility permissions they list.Moving the definitions also makes the YAML schema the only place that lists a role's permissions, so the Python constants change as follows:
COURSE_ADMINareRoleDataidentifiers without permissions, and code that needs a role's permissions can callget_permissions_for_single_role;*_PERMISSIONSlists and the unusedCOURSES_CREATE_COURSEconstant are removed, since nothing in openedx-platform reads them;openedx_authz.constants.permissionsandopenedx_authz.constants.rolesre-export each applet's constants, so existing import paths keep working.Also, installations that already applied the released schema still have source links pointing to the shared files, so
0012_move_builtin_schema_sources_to_appletsmoves them to the applets that now own those definitions.Since a role's permissions are now spread across several applets, the compiled schema is published as a readable snapshot in
docs/references/compiled-schema.yaml, which lists each role's permissions grouped by the applet that adds them. A test compares the snapshot with the compiled schema, which confirms that the move changes nothing else and makes any later applet change show its effect on the roles in the same diff.Testing instructions
main, runpython manage.py migrateandpython manage.py load_authz_schema.python manage.py migrate, which applies0012_move_builtin_schema_sources_to_applets.python manage.py load_authz_schema --dry-runand check that it reports "Authz schema unchanged; nothing would be written."Merge checklist:
Check off if complete or not applicable: