fix(replays): Allow org admins to bulk delete replays#115886
Merged
jameskeane merged 1 commit intoMay 20, 2026
Conversation
- Add org:admin scope check to useDeleteReplays hook - Update permission tooltip to include org:admin - Fix oneProjectEligible logic to only be true when project is resolved - Add tests for permission checks including org:admin access Fixes REPLAY-850 Co-authored-by: James Keane <james.keane.github@gmail.com>
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.56% |
JoshuaKGoldberg
approved these changes
May 20, 2026
Member
JoshuaKGoldberg
left a comment
There was a problem hiding this comment.
LGTM! I appreciate the testing coverage. 👏
JonasBa
pushed a commit
that referenced
this pull request
May 21, 2026
## Problem Users with Org Owner or Manager roles were unable to bulk delete Session Replays, even when a single project was explicitly selected. The Delete button remained disabled despite having the necessary organizational permissions. Fixes: REPLAY-850 ## Solution The issue was that the permission check in `useDeleteReplays` only looked for `project:write` and `project:admin` scopes, but Org Owners/Managers have `org:admin` scope instead. This PR: 1. **Adds `org:admin` scope check** to the `useDeleteReplays` hook, allowing users with organization-level admin access to delete replays 2. **Updates the permission tooltip** to reflect that `org:admin` access is sufficient 3. **Fixes the `oneProjectEligible` logic** to only be true when a project is successfully resolved (prevents confusing tooltip states) 4. **Adds comprehensive tests** for all permission scenarios Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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.
Problem
Users with Org Owner or Manager roles were unable to bulk delete Session Replays, even when a single project was explicitly selected. The Delete button remained disabled despite having the necessary organizational permissions.
Fixes: REPLAY-850
Solution
The issue was that the permission check in
useDeleteReplaysonly looked forproject:writeandproject:adminscopes, but Org Owners/Managers haveorg:adminscope instead. This PR:org:adminscope check to theuseDeleteReplayshook, allowing users with organization-level admin access to delete replaysorg:adminaccess is sufficientoneProjectEligiblelogic to only be true when a project is successfully resolved (prevents confusing tooltip states)