fix: expose members export in community groups#196
Conversation
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change introduces dedicated phone-export and all-groups permissions, propagates group IDs through authorization checks, centralizes CSV export UI, and updates group pages, admin access, and navigation to use the new permission model. ChangesGroup export access
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant GroupPage
participant GroupExportMenu
participant ExportAction
participant PermissionEvaluator
GroupPage->>PermissionEvaluator: check group export permissions with group scope
PermissionEvaluator-->>GroupPage: return export capabilities
GroupPage->>GroupExportMenu: render allowed export options
GroupExportMenu->>ExportAction: request CSV for groupId
ExportAction->>PermissionEvaluator: authorize export action
PermissionEvaluator-->>ExportAction: return authorization result
ExportAction-->>GroupExportMenu: return CSV data
GroupExportMenu-->>GroupPage: trigger browser download
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR fixes the export accessibility for
Confidence Score: 5/5Safe to merge — the authorization changes are self-consistent across UI gates, route guards, and server-side action checks. Every layer that enforces export access has been updated in lockstep: the new group.export_phone permission is denied to members_group_exporter in the evaluator, correctly applied in both server actions, and the client-side canExportPhone prop gates the dropdown entry. The groups.view_all consolidation is semantically identical to the previous three-way compound check. No regressions were found. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User visits group page] --> B{Route context}
B -->|/admin/groups/id| C{groups.view_all?}
B -->|/groups/id| D{group.export?}
C -->|No| E[redirect /membership]
C -->|Yes| F[Admin group detail page]
F --> G{canExport?}
G -->|No| H[No export button]
G -->|Yes| I[GroupExportMenu]
D -->|No| J[No export button]
D -->|Yes - members_group_exporter on 'members' group| K[GroupExportMenu]
D -->|Yes - admin/people_admin/legal/manager| K
I --> L{canExportPhone?}
K --> L
L -->|No| M[Plain Button: CSV for Luma]
L -->|Yes - admin/people_admin/legal/manager| N[Dropdown: CSV for Luma + Phone list]
M --> O[exportGroupCsvAction - guard: group.export]
N --> O
N --> P[exportGroupPhoneCsvAction - guard: group.export_phone]
style E fill:#f87171
style M fill:#86efac
style N fill:#86efac
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[User visits group page] --> B{Route context}
B -->|/admin/groups/id| C{groups.view_all?}
B -->|/groups/id| D{group.export?}
C -->|No| E[redirect /membership]
C -->|Yes| F[Admin group detail page]
F --> G{canExport?}
G -->|No| H[No export button]
G -->|Yes| I[GroupExportMenu]
D -->|No| J[No export button]
D -->|Yes - members_group_exporter on 'members' group| K[GroupExportMenu]
D -->|Yes - admin/people_admin/legal/manager| K
I --> L{canExportPhone?}
K --> L
L -->|No| M[Plain Button: CSV for Luma]
L -->|Yes - admin/people_admin/legal/manager| N[Dropdown: CSV for Luma + Phone list]
M --> O[exportGroupCsvAction - guard: group.export]
N --> O
N --> P[exportGroupPhoneCsvAction - guard: group.export_phone]
style E fill:#f87171
style M fill:#86efac
style N fill:#86efac
Reviews (2): Last reviewed commit: "Address PR review feedback (#196)" | Re-trigger Greptile |
- Use a direct button for single-option group exports
Summary
Members-group exporters can now open the Members group from the community Groups page and download the event-invitation CSV there. They still do not see or gain access to Admin > All groups; that area now uses an explicit organization-wide group-access permission shared by its navigation item and route guard.
The export menu also separates phone-list authorization from event export, so the narrow members exporter grant cannot expose member phone numbers through either the UI or direct server-action calls.
Validation
.next/devroute declarations and two unrelated test-fixture errorsKnown residual
Summary by CodeRabbit
New Features
Bug Fixes
Tests