Repository navigation
OpenConceptLab/ocl_online#742 | A collection's expansions list holds only versions the requester can view - #1034
Merged
snyaggarwal merged 2 commits intoNov 23, 2026
Conversation
…only expansions of versions the requester can view
snyaggarwal
commented
Nov 23, 2026
snyaggarwal
left a comment
Contributor
Author
There was a problem hiding this comment.
Verdict: ready to merge once CI passes. One optional nit on a88eb80.
What I checked:
- The filter:
get_viewable_versions_criteriais the query form ofhas_view_accessfrom #1027. Staff getNone, so no filter, which leaves their view as before. - Owners and org members: they match through
own, so their HEADs and private versions stay listed. - Inactive versions: they now drop out for non-staff, as their own routes already answer 404.
- The HEAD check: unchanged, so a private HEAD still answers 404 to outsiders.
- The test: it covers anonymous users, an outsider, an org member and staff. It fails without the fix with v1's expansion listed.
Nit (optional): CollectionExpansionsView's docstring still reads "List all expansions across all versions of a collection". "...across the versions of a collection the requester can view" would match what it does now.
…it holds only versions the requester can view
Contributor
Author
|
The docstring nit is fixed in the latest commit. |
snyaggarwal
commented
Nov 23, 2026
snyaggarwal
left a comment
Contributor
Author
There was a problem hiding this comment.
Verdict: ready to merge once CI passes. No findings on 51e82b1.
- The docstring fix checks out:
CollectionExpansionsViewnow describes what it returns. - The rest of the PR is unchanged since the last review, which found nothing else. The list keeps only versions the requester can view, through the #1027 criteria, and staff, owners and org members see no change. The test fails without the fix.
snyaggarwal
deleted the
ocl_online-742-expansions-list-viewable-versions
branch
November 23, 2026 11:55
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For OpenConceptLab/ocl_online#742.
/<owner>/collections/<collection>/expansions/checked view access on the collection's HEAD, then listed the expansions of every version. So anyone who could view a public HEAD also saw a private release's expansions:includeSummary=true, their concept and mapping counts;verbose=true, the source versions they were built from.What changes
CollectionExpansionsView.get_querysetnow keeps only the versions the requester can view. It usesCollection.get_viewable_versions_criteria(user)from #1027, the query form ofhas_view_access. Owners, org members and staff see no change, and staff get no filter at all.Tests
A new test in
CollectionViewsAPITestputs a public HEAD and a private v1 under one org. Anonymous users and outsiders see only HEAD's expansion; an org member and the admin see both. Without the fix, the test fails with v1's expansion listed. All 33 tests inCollectionViewsAPITestpass locally with Redis unreachable, as in CI, and pylint is clean on the changed files.🤖 Generated with Claude Code