Skip to content

fix(replays): Allow org admins to bulk delete replays#115886

Merged
jameskeane merged 1 commit into
masterfrom
jameskeane/fix-replay-bulk-delete-permissions-f76d
May 20, 2026
Merged

fix(replays): Allow org admins to bulk delete replays#115886
jameskeane merged 1 commit into
masterfrom
jameskeane/fix-replay-bulk-delete-permissions-f76d

Conversation

@jameskeane
Copy link
Copy Markdown
Contributor

@jameskeane jameskeane commented May 20, 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

- 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>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 20, 2026

REPLAY-850

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.56%

@jameskeane jameskeane marked this pull request as ready for review May 20, 2026 15:15
@jameskeane jameskeane requested a review from a team as a code owner May 20, 2026 15:15
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I appreciate the testing coverage. 👏

@jameskeane jameskeane merged commit f3c27f3 into master May 20, 2026
73 checks passed
@jameskeane jameskeane deleted the jameskeane/fix-replay-bulk-delete-permissions-f76d branch May 20, 2026 16:15
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>
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.

3 participants