Repository navigation
Conversation
|
Thanks for the pull request, @BryanttV! 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. |
87630ed to
38e53f9
Compare
ff2925f to
1853e86
Compare
| scopes: | ||
| - lib | ||
| icon: Plus | ||
| hidden: false |
There was a problem hiding this comment.
Non related to this line but if this is backward compatible should we bump the schema to 1.1? Or are we still considering 1.0 non released yet?
There was a problem hiding this comment.
Good question! I'd rather keep 1.0 for now. hidden is an optional field that defaults to false, so it's fully backward-compatible: every existing 1.0 file stays valid and means the same thing.
1853e86 to
e56225b
Compare
86a5262 to
9142c6a
Compare
Categories and permissions accept an optional `hidden` flag in the authz schema, persisted in the schema models. Hidden permissions, and the permissions of hidden categories, are left out of the role and permission catalog and of each role's permission list. Role grants and permission checks are unchanged, and role extensions cannot change the flag. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Mark the course_legacy permission category as hidden so the legacy compatibility permissions no longer appear in the role and permission catalog. Role grants and permission checks are unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
9142c6a to
e44c511
Compare
Description
Roles can be hidden with the
hiddenflag, but permission categories and permissions have no equivalent. Some permissions must keep working without being offered in discovery and selection interfaces, such as thelegacy_*compatibility permissions of thecourse_legacycategory, internal actions, or deprecated permissions. Because the role catalog feeds the Custom Roles permission picker, every permission in the schema is currently offered by default.This PR implements ADR 0038. Permission categories and permissions accept an optional
hiddenboolean (defaultfalse) in their base definitions.hidden: trueor when its category does.permissionslist. The category catalog only returns categories that still have a visible permission.0013), the change detection ofSchemaApplier, and the compiled schema snapshot.AuthzPermissionDefinition.objects.visible()is added, andget_permission_catalogandget_role_cataloguse it.course_legacycategory is nowhidden: true, so the legacy compatibility permissions no longer appear in the catalog.Affected roles: Developers and Operators who define schemas or consume the role catalog API; administrators using the Custom Roles feature no longer see the legacy compatibility permissions.
Supporting Information
docs/decisions/0038-hidden-permission-categories-and-permissions.rstTesting Instructions
Check out this branch and apply the migration:
Run the automated tests:
Regenerate the compiled schema and verify that there is no diff:
In
docs/references/compiled-schema.yaml, verify that thecourse_legacycategory hashidden: trueand that all other categories and permissions havehidden: false.Request the role catalog for the
course-v1scope type and verify that nolegacy_*permission appears inpermissions, in any role'spermissions, or incategories, and thatcourse_legacyis not listed.Verify that grants and checks are unchanged: a user with a legacy course role keeps the access they had before this change.
Set
hidden: "yes"on a category or permission in a schema file and verify that the schema is rejected as invalid (hiddenmust be a boolean).Deadline
Willow
Other Information
0013_add_hidden_to_categories_and_permissionsadds two boolean fields with a default ofFalse. It is reversible and does not require a data migration.permissionslist.