# [E9] Report export from the analytics dashboard

Review package · No changes have been applied to GitLab.
Analysis: 2026-09-10T02:08:47.511Z
Source fingerprint: 49c06423c882ec6e309a08e35d8e09eda42098df9d513a423f853585f2be7752

The decision establishes that report exports are restricted to members only to prevent guests from accessing member emails, explicitly overriding previous requirements that allowed guest access.

## Decision
Decision (maintainer): exports are **members-only**. Guests must not be able to download report data in any format. This overrides the "guests can export" line in the description. Rationale: exported rows can include member emails, which guests should never receive. Please treat this as the plan of record for this issue.
https://gitlab.com/buildsimpul/drift-agent-sandbox/-/issues/9#note_3811786961

## Decision provenance
Issue: https://gitlab.com/buildsimpul/drift-agent-sandbox/-/work_items/9
Chosen decision: Decision (maintainer): exports are **members-only**. Guests must not be able to download report data in any format. This overrides the "guests can export" line in the description. Rationale: exported rows can include member emails, which guests should never receive. Please treat this as the plan of record for this issue.
Summary: Report exports are restricted to members only to prevent guests from accessing member email addresses.
Note permalink: https://gitlab.com/buildsimpul/drift-agent-sandbox/-/issues/9#note_3811786961
Author: buildsimpul
Role: unknown
Source authority: unverified (author role unknown)
Confirmed by reviewer at 2026-09-10T02:07:37.435Z
Other candidates considered:
- The author asks if guests should be permitted to export reports containing member email addresses. — unverified, question: The note raises a concern about the current scope without providing a directive.
- The author asks whether the export button should be hidden or disabled for guest users. — unverified, question: The note identifies an unresolved UI implementation detail.
- The author suggests a future enhancement where guests could export reports with sensitive columns removed. — unverified, proposal: The note offers a suggestion for a potential follow-up feature.
- The developer has begun work on the UI component but is waiting for a decision on guest visibility. — unverified, status: The note provides an update on development progress and blockers.
- The export button will be hidden from guest users rather than shown in a disabled state. — unverified, decision: The note states a decision regarding the UI visibility for guests.

## Prepared work
### Corrected description draft
## Summary
Add a "Download report" action to the analytics dashboard so people can export the current view.

## Who can use it
- Exports are members-only. Guests must not be able to download report data in any format.
- The "Download report" button is hidden from guests.

## Formats
- CSV export of the currently filtered rows.

## Acceptance
- A member opens the analytics dashboard and clicks "Download report"; a CSV downloads.
- A guest opens the analytics dashboard; the "Download report" button is hidden.
- The button label is "Download report".

### Proposed tests
- Verify that a user with Member permissions can see the 'Download report' button.
- Verify that clicking 'Download report' as a Member triggers a CSV download of filtered rows.
- Verify that a user with Guest permissions cannot see the 'Download report' button.
- Verify that the 'Download report' API endpoint rejects requests from Guest users.

### Engineering handoff
The implementation must restrict report exports to members only to prevent guests from accessing member email addresses. The frontend should hide the export button for guests entirely, as per the latest sandbox decision. Backend enforcement is required to ensure guests cannot bypass the UI to trigger a download.

### Open questions
- Should the system provide a specific error message if a guest attempts to access the export URL directly?
- Are there any other user roles (e.g., Admin, Owner) that need explicit confirmation for export access, or is it strictly 'Member' and above?
- Is the 'email column stripped' CSV for guests confirmed as a future follow-up, or should it be considered for this scope?

## Design notes
Assessment: conflict · Review: approved

The design notes allow both members and guests to see and use the download button, which contradicts the decision to restrict exports to members only.

Decision evidence:
> exports are **members-only**

Item evidence:
> Members and guests see the Download report button.
(no link supplied)

### Approved draft
Members see the Download report button and can download a CSV of the currently filtered rows. Hide the button from guests; guest export requests must be denied. The button label is Download report.

## Acceptance tests
Assessment: conflict · Review: approved

The acceptance tests explicitly require that a CSV downloads when a guest clicks the button, which is forbidden by the new decision.

Decision evidence:
> Guests must not be able to download report data in any format.

Item evidence:
> Given a guest opens the analytics dashboard, when they click Download report, then a CSV downloads.
(no link supplied)

### Approved draft
Given a guest opens the dashboard, then the Download report button is hidden. Given a guest requests the export endpoint directly, then the request is denied and no report data is returned. Given a member clicks Download report, then a CSV downloads with the currently filtered rows.
