Skip to content

Improve checks for file move and pipeline status API#7768

Merged
labkey-jeckels merged 2 commits into
release25.7-SNAPSHOTfrom
25.7_fb_scopingTestFixes
Jun 17, 2026
Merged

Improve checks for file move and pipeline status API#7768
labkey-jeckels merged 2 commits into
release25.7-SNAPSHOTfrom
25.7_fb_scopingTestFixes

Conversation

@labkey-jeckels

@labkey-jeckels labkey-jeckels commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Rationale

Previous scoping changes weren't correct given some important use cases for compability.

Changes

  • Don't consider an import of a file to prevent moving it via WebDAV
  • Allow users with read access to the parent container to access the pipeline job status API via any container

Tasks 📍

  • Claude Code Review
  • Manual Testing
  • Test Automation

@labkey-jeckels labkey-jeckels self-assigned this Jun 17, 2026
assertTrue("Destination file should exist after a successful move", FileUtil.appendName(targetDir, "moved.txt").exists());
}

// A.1: canDelete() and canMove() diverge ONLY for a file that backs experiment data (used by a run).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A.1:? What's that referring to?

assertTrue("Admin MUST still be able to move a file that has been imported by an assay", resource.canMove(admin));
}

// A.2: The same divergence end-to-end through WebdavServlet. A file that backs experiment data is refused

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove A.2?

assertEquals("DELETE of a file imported by an assay must be forbidden", HttpServletResponse.SC_FORBIDDEN, deleteResp.getStatus());
assertTrue("File must still exist after a forbidden delete", importedForDelete.exists());

// MOVE of an equally-imported file succeeds, relocating it within the file root.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equally-imported? What does that mean?


PipelineStatusFile psf = getStatusFile(form.getRowId());
if (psf == null || !getContainer().equals(psf.lookupContainer()))
if (psf == null || psf.lookupContainer() == null || !psf.lookupContainer().hasPermission(getUser(), ReadPermission.class))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messaging for the case when the user does not have permission will not be quite right here. Seems like it should throw and UnauthorizedException instead.

// This API authorizes against the job's OWN container (folder B), not the container in the URL, so it
// intentionally supports referencing a job from another container -- but only for a caller who can read the
// container the job actually lives in.
// A caller who can read folder A but NOT folder B must still get 404: the job must not be revealed to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say the 404 is less appropriate here (see comment above), but I won't insist.

@labkey-jeckels labkey-jeckels merged commit 2dd91ea into release25.7-SNAPSHOT Jun 17, 2026
10 of 14 checks passed
@labkey-jeckels labkey-jeckels deleted the 25.7_fb_scopingTestFixes branch June 17, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants