fix(performance): Hide sample transaction button without event:write#116801
Merged
skaasten merged 1 commit intoJun 4, 2026
Merged
Conversation
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>
gggritso
approved these changes
Jun 3, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theevent:write(orevent:admin) scope viaProjectEventPermission. Members without that scope got a 403 Forbidden.This gates
SampleButtononevent:write/event:adminaccess.The check lives inside the shared
SampleButtoncomponent, so it covers both render sites (LegacyOnboardingand the EAPOnboarding).Fixes JAVASCRIPT-33CY
Refs DAIN-1003