-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Restrict payout confirmation to workspace owners #2591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
limit the confirm payouts to workspace owners only
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis update implements a role-based permission system for confirming payouts. It introduces a new "payouts.write" permission, restricts payout confirmations to workspace owners, and updates UI and backend logic to enforce these checks. User roles are now surfaced more directly in context objects to support authorization. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI (PayoutStats)
participant Server (confirmPayoutsAction)
participant Permissions
User->>UI (PayoutStats): Attempt to confirm payouts
UI (PayoutStats)->>Permissions: Check "payouts.write" for user role
Permissions-->>UI (PayoutStats): Allow or deny (with error message)
alt Permission granted
UI (PayoutStats)->>Server (confirmPayoutsAction): Submit confirm payouts request
Server (confirmPayoutsAction)->>Permissions: Validate user role is "owner"
Permissions-->>Server (confirmPayoutsAction): Allow or throw error
Server (confirmPayoutsAction)-->>UI (PayoutStats): Success or error
else Permission denied
UI (PayoutStats)-->>User: Show disabled button with tooltip
end
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningsapps/web/ui/partners/payout-invoice-sheet.tsx (1)⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
limit the confirm payouts to workspace owners only
Summary by CodeRabbit