Limit the Isotope/Structural modification grids to the current folder…#662
Open
vagisha wants to merge 1 commit into
Open
Limit the Isotope/Structural modification grids to the current folder…#662vagisha wants to merge 1 commit into
vagisha wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prevents Panorama Public modification grids (Isotope/Structural) from being widened to expensive cross-folder scopes via hand-crafted URLs, by clamping container filters to the current folder tree.
Changes:
- Added
PanoramaPublicSchema.limitContainerScope(...)to restrict any container filter broader than Current/CurrentAndSubfolders down to CurrentAndSubfolders. - Applied the restriction to the full query grids via
PanoramaPublicSchema.createView(...)for the Isotope/Structural modification queries. - Applied the same restriction to standalone modification web parts via
ModificationsView.getContainerFilter(), and added regression UI tests covering both entry points.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicSchema.java | Adds the shared container-scope limiting helper and applies it to the two modification query grids. |
| panoramapublic/src/org/labkey/panoramapublic/query/modification/ModificationsView.java | Clamps container filters for standalone modification web parts to prevent URL-based widening. |
| panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicModificationsTest.java | Adds UI tests ensuring both the menu and URL parameters cannot expand scope to All Folders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Rationale
The modification web part title links to the full query grid, where an "All Folders" filter could be applied, leading to very slow queries. Restricting the Folder Filter menu is not enough because a hand-built
query.containerFilterName=AllFoldersURL still applies.Changes
PanoramaPublicSchema.limitContainerScopehelper that restricts any container filter wider than the current folder and subfolders down to CurrentAndSubfolders.PanoramaPublicSchema.createViewcalls the helper for theIsotopeModificationsandStructuralModificationsgrids.ModificationsView.getContainerFiltercalls the same helper, closing the same gap on the standalone web parts. It is a no-op on the experiment details page, which already pins the scope.Tests
PanoramaPublicModificationsTest.verifyModificationQueryScopeIsRestrictedchecks that the Folder Filter menu does not include All Folders, and that a query.containerFilterName=AllFolders URL is restricted to CurrentAndSubfolders.PanoramaPublicModificationsTest.verifyModificationWebPartScopeIsRestricteddrives the standalone web part URL and checks the same restriction.Co-Authored-By: Claude noreply@anthropic.com