-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix: platform-wide glob role assignments crash get_orgs_for_user/has_org_for_user #38980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
efortish
wants to merge
7
commits into
openedx:master
Choose a base branch
from
eduNEXT:ks/issue-380-platform-glob-org
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+72
−4
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
65b57d9
fix: platform-wide glob role assignments crash get_orgs_for_user/has_…
efortish 526ea04
chore: retrigger CI (flaky JS video-volume-control test)
efortish 8b92fc6
Merge branch 'master' into ks/issue-380-platform-glob-org
efortish ace8a06
refactor: use build_external_key() instead of hardcoded glob key strings
efortish d32aa52
Merge remote-tracking branch 'ednx/ks/issue-380-platform-glob-org' in…
efortish 795de56
refactor: use assign_role_to_user_in_scope instead of mocking assignm…
efortish fbb2726
test: add subset-vs-all-orgs coverage for _authz_get_orgs_for_user
efortish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late to this review. Does this return the same structure as in L641? Can we make sure of this with a test - like a test case that for a user returns a subset and for another all orgs? Not sure if we're doing that already. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries about the timing! Yes — both branches return the same shape, a plain list[str] of org short names (L640 is a list comprehension over get_organizations(), L641 is list(a set) of assignment.scope.org values). Added test_get_orgs_for_user_authz_platform_glob_vs_org_scoped: it registers a third org that's never assigned to anyone, then asserts an org-scoped grant returns only its own org while a platform-wide grant returns all three, against that same shared pool of orgs — so the two branches are actually distinguished instead of just coincidentally returning the same numbers (which is what my original platform_glob test alone couldn't rule out, since it only ever registered exactly the orgs it expected back). Verified locally against a real devstack. Fixed in fbb2726.