Skip to content

fix(performance): Hide sample transaction button without event:write#116801

Merged
skaasten merged 1 commit into
masterfrom
shaunkaasten/dain-1003-view-sample-transaction-button-fails
Jun 4, 2026
Merged

fix(performance): Hide sample transaction button without event:write#116801
skaasten merged 1 commit into
masterfrom
shaunkaasten/dain-1003-view-sample-transaction-button-fails

Conversation

@skaasten

@skaasten skaasten commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The performance onboarding empty state rendered a "View Sample Transaction" / "Take me to an example" button (SampleButton) for every user.

The endpoint it calls — POST /projects/{org}/{project}/create-sample-transaction/ — requires the event:write (or event:admin) scope via ProjectEventPermission. Members without that scope got a 403 Forbidden.

This gates SampleButton on event:write/event:admin access.

The check lives inside the shared SampleButton component, so it covers both render sites (LegacyOnboarding and the EAP Onboarding).

Fixes JAVASCRIPT-33CY
Refs DAIN-1003

The performance onboarding empty state rendered a "View Sample
Transaction" button for every user. The endpoint it calls requires the
event:write (or event:admin) scope, so members without that scope hit a
403 and saw a generic error toast (which was also captured as an
exception, polluting the issue stream).

Gate the button on event:write/event:admin access via hasEveryAccess and
hide it entirely when the user lacks the scope, so only users who can
actually create a sample transaction see it.

Fixes JAVASCRIPT-33CY
Refs DAIN-1003
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@skaasten skaasten requested a review from a team as a code owner June 3, 2026 19:12
@linear-code

linear-code Bot commented Jun 3, 2026

Copy link
Copy Markdown

DAIN-1003

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 3, 2026
@skaasten skaasten merged commit c933328 into master Jun 4, 2026
72 checks passed
@skaasten skaasten deleted the shaunkaasten/dain-1003-view-sample-transaction-button-fails branch June 4, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants