Repository navigation
fix(frontend): let approve-any holders approve scheduler-created rows under four-eyes - #1122
Merged
Merged
Conversation
… under four-eyes Refs #233 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@coderabbitai review |
Contributor
Member
Author
|
Independent review A (Claude Sonnet, high, non-author): APPROVE 4375a74
|
Member
Author
|
Independent review B (Claude Opus, high, non-author): APPROVE 4375a74
|
Contributor
|
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.
Summary
Closes #233: the History UI's four-eyes gate now lets an approve-any holder approve rows the scheduler created.
#1071 shipped the backend half of the owner's Option B (2026-10-17). Rows created by the notification sweep carry
created_by_system, andrequireDifferentApproverlets an identified approver approve them. The frontend still treated every row without a creator as legacy.canApproveUnder4Eyesreturned false, so approve-any holders saw "No recorded creator - an admin must disable 4-eyes mode" on rows the backend would accept.Change
frontend/src/types.ts: optionalcreated_by_systemonHistoryPurchase. This mirrors thecreated_by_system,omitemptytag ininternal/config/types.gothatinternal/api/handler_history.goprojects.frontend/src/history.ts: with four-eyes on, a row without a creator passescanApproveUnder4Eyesonly whencreated_by_system === true. Rows with a creator still require a different approver. Four-eyes off is unchanged. The approve-own exclusion for system rows stays inrbacAllowsApprove, which already denies approve-own on rows without a creator, matchingauthorizeSessionApprove.four-eyes-approval.test.ts:Verification (local, macOS)
npx jest src/__tests__/four-eyes-approval.test.ts, 1 failed / 12 passed. GREEN after: 13/13.history.tschange makes the new approve-any test fail again.npm test: 108 suites, 3400 passed, 1 skipped.npm run lint: 0 errors.npm run build: OK. Pre-commit hooks passed.The backend still enforces approve-any constraints. This only stops the UI from hiding a valid action.
🤖 Generated with Claude Code
Summary by CodeRabbit