feat: support organization-level scopes for course list [authz]#38307
feat: support organization-level scopes for course list [authz]#38307bmtcril merged 2 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @MaferMazu! 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. |
13d2947 to
646964b
Compare
646964b to
9640095
Compare
dwong2708
left a comment
There was a problem hiding this comment.
Looks good overall! Just a couple of comments, thanks.
There was a problem hiding this comment.
Pull request overview
Adds organization-level AuthZ scope handling to Studio’s course listing so users with org-wide permissions can see all courses in their org (addressing openedx-authz#243), rather than only explicitly-scoped courses.
Changes:
- Extend
_get_authz_accessible_courses_listto expandOrgCourseOverviewGlobDatascopes into course keys for the org and apply the per-course authoring toggle. - Add unit tests covering org-scope inclusion and toggle filtering behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cms/djangoapps/contentstore/views/course.py |
Expands AuthZ course listing to include org-scoped permissions by querying org courses and filtering by the waffle flag. |
cms/djangoapps/contentstore/tests/test_course_listing.py |
Adds tests for org-scope behavior and toggle-respecting filtering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rodmgwgu
left a comment
There was a problem hiding this comment.
Looking good overall, just some comments. Thanks!
150bc33 to
f63e9a1
Compare
|
@MaferMazu just a minor comment, could you add something like the following to the PR description? Resolves: openedx/openedx-authz#243 This helps link the task to the PR. I noticed you already included the link, but keywords like “Resolves” or “Closes” are needed for it to work properly. |
ef0960e to
c40dc9d
Compare
fix: apply feedback related to test and types refactor: abstract process in _get_course_keys_from_scopes
c40dc9d to
ea0765d
Compare
Add noqa comments to suppress PT009 linting warnings for unittest-style assertions (assertEqual, assertTrue, etc.) which are appropriate for tests inheriting from unittest.TestCase/ModuleStoreTestCase.
|
This is ready for re-review @mariajgrimaldi @dwong2708 @rodmgwgu 🙌 |
rodmgwgu
left a comment
There was a problem hiding this comment.
Tested in my local and works as described, thanks!
Description
This change addresses openedx/openedx-authz#243 by enabling the retrieval of course listings based on organization-level permissions for authz.
Previously, users with course roles via authz were limited to viewing only explicitly assigned courses in the CMS, as organization scopes were not considered during the lookup.
With this update, users with organization-wide permissions will now correctly see all courses in their organization in their course listing.
Supporting information
Resolves: openedx/openedx-authz#243
Testing instructions
The tests added are only unit tests. If you want to check an end-to-end test, follow the following instructions:
Requirements:
g user^student1 role^course_staff course-v1^course-v1:openedx+*(in this case, the org is openedx)Test:
Deadline
Verawood