Add scopes for partner program resources #4652
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 310 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.343
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4652"
general
weight: 0.35
Joker666
Partner program endpoints now require API scopes, so access can be limited to partners, applications, customers, discount codes, commissions, bounties, and payouts.
Key Changes
apis.readandapis.allinclude them.groups.readandgroups.writeare now OAuth scopes and show in the API key picker.GET /api/partners/linksrequireslinks.read, so viewer and billing can list partner links.POSTrequireslinks.write.2026-10-09, or with no date, a key or installation keeps the new permissions, except groups, within the workspace role. OAuth uses the installation date. Cached restricted tokens missing that date are reloaded.How to Test
partners.readcanGET /api/partners. Create, ban, and deactivate return 403. Same for customers, discount codes, commissions (includingGET /api/commissions/:id), bounty submissions, and payout lists.GET /api/partners/linkssucceeds andPOSTreturns 403.Deploy
2026-10-09) to the merge date before merging.Notes
GET /api/partners/:partnerId, bounty create and update, and exports still have no scope check.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added separate read and write permissions for partners, partner links, program applications, customers, discount codes, commissions, and bounties, plus read access for payouts.
Updated access checks across these features to use permissions while retaining existing plan requirements. Read permissions are available to additional workspace roles; write permissions remain limited to authorized roles.
Eligible older tokens retain applicable access under the updated permission system.
Improvements
Made the token-permissions list easier to navigate with a scrollable layout and more compact rows.
* Permission guidance is now shown when refreshing bounty statistics is unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->