Repository navigation
feat(replays): Grant replay access to teams - #130558
Draft
sentry-junior[bot] wants to merge 2 commits into
Draft
sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
Let owners and managers grant replay access to whole teams, not only individual members. Team membership is checked on every request, so access follows membership changes, including SCIM group sync from an identity provider. Co-Authored-By: Michael Chai <michael.chai@sentry.io>
Contributor
decision-model-linterapi
decision-model-linter: 21 calls on 6 files, 43,908 input tokens, $0.0018, model typesafe/jev-1.13-20260917 |
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Create model TeamReplayAccess
--
CREATE TABLE "sentry_teamreplayaccess" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "team_id" bigint NOT NULL UNIQUE);
ALTER TABLE "sentry_teamreplayaccess" ADD CONSTRAINT "sentry_teamreplayaccess_team_id_0fe0e5ce_fk_sentry_team_id" FOREIGN KEY ("team_id") REFERENCES "sentry_team" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_teamreplayaccess" VALIDATE CONSTRAINT "sentry_teamreplayaccess_team_id_0fe0e5ce_fk_sentry_team_id"; |
This branch has not been deployed
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.
Granular replay permissions currently take only a list of individual users. Orgs that manage access through their identity provider want replay access to follow an IdP group: a member gets access when they are added to the group and loses it when they are removed. SCIM already syncs IdP groups into Sentry teams, so this PR lets replay access be granted to teams.
TeamReplayAccessmodel with one row per granted team. The row is deleted along with its team.has_replay_permissionnow also allows active members of a granted team whose team is active. Membership is checked on every request, so removing someone from the team through SCIM revokes access on their next request. There is no copied list that could go stale. A SCIM test covers this end to end.replayAccessTeams(team IDs). It uses the sameorg:writecheck and audit log entry asreplayAccessMembers. The org serializer returnsreplayAccessTeams.Follow-up: a frontend PR, separate because frontend and backend deploy separately.
useHasReplayAccesschecks onlyreplayAccessMemberstoday, so it needs to check the user's team membership as well. The settings form also needs a team picker. Until that lands, the backend enforces access correctly, but the UI can hide replays from members who only have access through a team.via Michael Chai.
--
View Session [Sentry]