fix(approvals-inbox): align participant gating with the server-computed viewer block (framework#3310)#2719
Merged
Conversation
…ed viewer block
Consume framework#3310's per-viewer capability. `ApprovalRequestRow` gains an
optional `viewer: { can_act, is_submitter }`, and the inbox's participant checks
(the reply box + the "why disabled" hint) prefer it over the client-side
identity heuristic when present — so the hint never contradicts the declared
decision buttons (whose `visible` CEL now gates on `record.viewer.*`), and
position/team-addressed approvers the heuristic couldn't resolve are recognized.
The heuristic stays as a fallback for a backend that predates `viewer`.
Verified in-browser: a submitter viewing their own pending request no longer
sees approve/reject/reassign/send-back/request-info (all hidden), only remind
and recall; `getRequest` returns `viewer: {can_act:false, is_submitter:true}`.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ypkQikZ55oWUHUnMebwXA
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 20, 2026 03:36
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.
Console half of framework#3310. Consumes the new server-computed per-viewer capability so the inbox's participant gating matches the (now precisely gated) declared decision buttons.
What
ApprovalRequestRow(services/approvalsApi.ts) gains an optionalviewer: { can_act, is_submitter }— attached bygetRequest/listRequestson the framework side.record.viewerover the client-side identity heuristic when present. This keeps the hint from contradicting the declared decision buttons (whosevisibleCEL now gates onrecord.viewer.*) and correctly recognizes position/team-addressed approvers the client heuristic couldn't resolve. The heuristic remains as a fallback for a backend that predatesviewer.No new UI: the decision buttons themselves are server-declared and gate via their own CEL — this PR only aligns the surrounding hint/reply affordances.
Verification
Browser, live backend (framework#3310):
status == "pending"gating and 403'd on click).getRequestreturnedviewer: {can_act:false, is_submitter:true}; the reply box + hint render consistently with the buttons.Refs
framework#3310 (server
viewercapability) · #2697 / #2710 (button retirement) · #2678 (P2-4)🤖 Generated with Claude Code
Generated by Claude Code