feat: add platform glob scope support#38660
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. |
d723edb to
098c927
Compare
MaferMazu
left a comment
There was a problem hiding this comment.
Hello @BryanttV, thanks for this PR.
Regarding the functionality, this works as expected! ✅
I review it, and it looks good, just a small comment.
And to verify the test pass, we should use the hash of your last commit in openedx-authz (then you can change it again to v1.16.0).
799bee6 to
1c1cd49
Compare
1c1cd49 to
a0429c0
Compare
|
@MaferMazu, Thanks for the suggestion. I added a temporary commit to test the changes in |
2f904ba to
2fc06f0
Compare
2fc06f0 to
4a0ebbb
Compare
8a69af3 to
72e46d1
Compare
e5baeea to
3fda3a3
Compare
There was a problem hiding this comment.
@BryanttV, thanks for updating this PR.
Reading this PR again, I was wondering how checking the waffle flag by course will impact performance when a role assignment has platform scope, because we would check N courses in _get_course_keys_from_platform_scope.
What you implemented is a logic approach, but in terms of cost, perhaps we should check whether the waffle flag is enabled per platform (globally), since this global scope doesn't make much sense if the waffle flag is by course. What do you think?
Btw, the rest looks good to me.
3fda3a3 to
1d3dd18
Compare
1d3dd18 to
3d10399
Compare
Resolves: openedx/openedx-authz#268
Resolves: openedx/openedx-authz#307
Description
This PR adds support for platform-wide scopes (
PlatformCourseOverviewGlobDataandPlatformContentLibraryGlobData) when resolving AuthZ permissions, so users with global access can see all courses (when the authz course-authoring feature flag is enabled) or content libraries.Related PRs
Testing instructions
Using Tutor:
Use the changes in feat: add platform-level glob scope openedx-authz#289 and feat: add platform-level glob scope for content libraries openedx-authz#333
Enable the
authz.enable_course_authoringflag globally, or in the courses or organizations of your choice.Create a new user.
Assign them course and content library permissions at the platform level using the
openedx-authzendpoint ({{lms_domain}}/api/authz/v1/roles/users/), e.g.:Content Libraries
{ "users": [ "john" ], "role": "library_admin", "scopes": [ "lib:*" ] }Courses
{ "users": [ "john" ], "role": "course_admin", "scopes": [ "course-v1:*" ] }Verify the course list in Studio. All courses with the flag enabled should appear.
Verify the content library list in Studio. All created libraries should appear.
Deadline
None