Skip to content

Commit 7814fb8

Browse files
test(pull-requests): a reported edit permission can't widen the host's capability
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 2837cec commit 7814fb8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎apps/web/src/components/pullRequest/pullRequestEditing.logic.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ describe("canEditPullRequestChangeRequest", () => {
106106
}),
107107
),
108108
).toBe(false);
109+
// The host can't rewrite change requests at all, so the reader's answer can't widen that.
110+
expect(
111+
canEditPullRequestChangeRequest(
112+
subject({
113+
capabilities: capabilities({ changeRequest: false, comment: true }),
114+
viewerPermissions: permissions({ editChangeRequest: true }),
115+
}),
116+
),
117+
).toBe(false);
109118
});
110119

111120
it("refuses a reader who neither wrote it nor may merge it", () => {

0 commit comments

Comments
 (0)