Skip to content

[DT-4061] Gate study PATCH on ownership of the study - #3050

Open
otchet-broad wants to merge 1 commit into
otchet-dt-4061-study-visibility-authzfrom
otchet-dt-4061-study-patch-ownership
Open

[DT-4061] Gate study PATCH on ownership of the study#3050
otchet-broad wants to merge 1 commit into
otchet-dt-4061-study-visibility-authzfrom
otchet-dt-4061-study-patch-ownership

Conversation

@otchet-broad

Copy link
Copy Markdown
Contributor

Base: branch 1 · 3 files, +41/-3 · Migration: no · UI impact: yes — the one to scrutinize

Requires creator/custodian/admin ownership for PATCH /api/dataset/study/{studyId}, matching what the registration PUT path
already enforces. The @RolesAllowed gate on the endpoint only says the
caller holds a study-editing role somewhere in DUOS, and a publicly visible
study passes the read-visibility check for everyone, so read visibility
cannot stand in for write authorization.

This is a behavior tightening: a chairperson or data submitter who is not
the study's creator or custodian now receives 403 where a PATCH of a
publicly visible study previously succeeded. Worth confirming against how
the UI gates the study edit form before merging.

Deliberately a sibling of branch 1 rather than a link in the chain. Nothing
else in DT-4061 depends on it, so it can be held for a longer discussion,
revised, or dropped without blocking the other seven PRs. Small enough to
review in one sitting: the resource hunk, one new test, and the OpenAPI 403
documentation.

Depends on: branch 1 (shares the StudyResource PATCH method).


Where this sits in the DT-4061 stack

otchet-dt-3990-study-ratings-pi-details was too large to review meaningfully
(95 files, +8168), so it was split into eight PRs. This PR targets otchet-dt-4061-study-visibility-authz,
not develop
, so its diff shows only its own work.

# Branch Base
1 otchet-dt-4061-study-visibility-authz develop
1b otchet-dt-4061-study-patch-ownershipthis PR otchet-dt-4061-study-visibility-authz
2 otchet-dt-4061-study-pi-details otchet-dt-4061-study-visibility-authz
3 otchet-dt-4061-study-comments otchet-dt-4061-study-pi-details
4 otchet-dt-4061-study-dar-metrics otchet-dt-4061-study-comments
5 otchet-dt-4061-study-recommendations otchet-dt-4061-study-dar-metrics
6 otchet-dt-4061-study-asset-fields otchet-dt-4061-study-recommendations
7 otchet-dt-4061-study-asset-endpoints otchet-dt-4061-study-asset-fields

Branch 1b is a sibling rather than a link in the chain: nothing depends on it,
so it can be held or dropped without blocking the others. Land the numbered
chain in order — merging out of order, or squash-merging, will require rebasing
the descendants.

The split is verified lossless: branch 7 plus 1b reproduces the original branch
exactly, apart from five scripts/verify-study-*.sh helper scripts that were
dropped at the author's request. ./mvnw test-compile passes on each branch
independently.

🤖 Generated with Claude Code

@otchet-broad
otchet-broad marked this pull request as ready for review September 8, 2026 20:30
@otchet-broad
otchet-broad requested a review from a team as a code owner September 8, 2026 20:30
@otchet-broad
otchet-broad requested review from fboulnois and rushtong and removed request for a team September 8, 2026 20:30
Requires creator/custodian/admin ownership for PATCH
/api/dataset/study/{studyId}, matching what the registration PUT path
already enforces. The @RolesAllowed gate on the endpoint only says the
caller holds a study-editing role somewhere in DUOS, and a publicly
visible study passes the read-visibility check for everyone, so read
visibility cannot stand in for write authorization.

This is a behavior tightening, and the only change in the DT-4061 stack
that can break a live UI flow: a chairperson or data submitter who is not
the study's creator or custodian now receives 403 where a PATCH of a
publicly visible study previously succeeded. Worth confirming against how
the UI gates the study edit form before merging.

Split out of otchet-dt-4061-study-visibility-authz so it can be held or
reverted without blocking the rest of the stack. It is a sibling of that
branch rather than part of the chain — nothing else depends on it.

No migration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-patch-ownership branch from c1dc841 to 9359c86 Compare September 8, 2026 21:58
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-visibility-authz branch from 1f57fc7 to 0233a80 Compare September 8, 2026 21:58
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.

1 participant