feat: scope and preselect PAT org role in create dialog#1704
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PAT form dialog gains permission-driven org role filtering: it queries org-update permissions via ChangesPAT Form Permission Filtering and Refetch Fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/sdk/client/views/pat/components/pat-form-dialog.tsx (1)
494-499: 💤 Low valueConsider UX when editing a PAT with a no-longer-selectable role.
If a user edits a PAT whose org role grants
org_updatebut the user no longer has that permission, the selected value won't appear in the dropdown options. The Select component may show the raw value or placeholder, causing confusion.Since backend enforcement prevents privilege escalation anyway, this is a minor UX edge case — consider showing a disabled option for the current role or a hint message when this mismatch occurs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6bd100d2-fb8a-4df6-96ba-dfe37bbf6981
📒 Files selected for processing (2)
web/sdk/client/views/pat/components/pat-form-dialog.tsxweb/sdk/client/views/pat/pat-view.tsx
💤 Files with no reviewable changes (1)
- web/sdk/client/views/pat/pat-view.tsx
Coverage Report for CI Build 27681163693Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage remained the same at 43.631%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary
updatepermission now only see non-admin roles. Uses a singleBatchCheckPermissionself-check; no privilege escalation since the backend already caps a PAT atmin(user role, PAT scope).onClosehandler.