Repository navigation
Conversation
|
Thanks for the pull request, @rodmgwgu! 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. |
2372f06 to
3639c64
Compare
Closes #673
Problem
Since #649, editing a custom role keeps the hidden permissions it already grants, as ADR 0038 requires. The role catalog does not list hidden permissions, so when a schema load hides a permission, or its category, that a custom role grants, the UI stops showing that permission in the role and nobody can see or edit it there. The grant keeps working, and nothing tells the operator.
Approach
SchemaApplier.plannow reportshidden_custom_grants: each permission the compiled schema hides that is still visible in the stored definitions, with the custom roles that grant it. The plan runs before definitions are synced, so comparing the two finds only the permissions this load hides. A permission hidden by an earlier load is not reported again.load_authz_schemaprints a "Custom role grants of hidden permissions" section in dry-run and apply mode.Manual testing instructions
In a dev environment with a custom role that grants a visible permission (e.g.
courses.manage_tags):hidden: trueon that permission, or on its category, in the schema YAML.python manage.py lms load_authz_schema --dry-run. The report lists the permission and the custom role under "Custom role grants of hidden permissions".python manage.py lms load_authz_schema. It succeeds, logs the warning, and the custom role still grants the permission.Unit tests:
pytest src/openedx_authz/tests/schema/test_apply.py src/openedx_authz/tests/schema/test_load_authz_schema_command.py -k "Hidden or hidden".Rollback plan
Revert this PR. No migration and no stored data.
Retro compatibility
ChangePlangains a field with an empty default. The load behaves the same apart from the new warning and report section.AI Usage
🤖 This change was made with assistance from Kiro, with human guidance on the decisions and validation against ADR 0038.
Merge checklist: