Drop redundant access source organization checks

Scoped LoadByID already enforces tenant isolation; remove
OrganizationID comparisons against the campaign in create, sync,
add source, and review engine paths.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-27 14:11:49 +00:00
parent 6fc3b1e3e3
commit f396107090
2 changed files with 0 additions and 16 deletions

View File

@@ -69,10 +69,6 @@ func (s *Service) CreateCampaign(
return fmt.Errorf("cannot load access source: %w", err)
}
if source.OrganizationID != campaign.OrganizationID {
return coredata.ErrResourceNotFound
}
if err := s.upsertCampaignSource(ctx, conn, scope, campaign.ID, source); err != nil {
return fmt.Errorf("cannot snapshot scope source: %w", err)
}
@@ -252,10 +248,6 @@ func (s *Service) AddCampaignSource(
return fmt.Errorf("cannot load access source: %w", err)
}
if source.OrganizationID != campaign.OrganizationID {
return coredata.ErrResourceNotFound
}
if err := s.upsertCampaignSource(ctx, conn, scope, campaign.ID, source); err != nil {
return fmt.Errorf("cannot snapshot scope source: %w", err)
}
@@ -340,10 +332,6 @@ func (s *Service) syncCampaignSources(
return fmt.Errorf("cannot load access source: %w", err)
}
if source.OrganizationID != campaign.OrganizationID {
return coredata.ErrResourceNotFound
}
if err := s.upsertCampaignSource(ctx, conn, scope, campaign.ID, source); err != nil {
return fmt.Errorf("cannot snapshot scope source: %w", err)
}

View File

@@ -67,10 +67,6 @@ func (s *Service) FetchSource(
return fmt.Errorf("cannot load access source %s: %w", sourceID, err)
}
if source.OrganizationID != campaign.OrganizationID {
return fmt.Errorf("cannot process access source: %s does not belong to campaign organization", sourceID)
}
var err error
driver, err = s.resolveDriver(ctx, tx, scope, source)