Allow deleting access review campaigns in any status
Drop the backend status gate on campaign delete and show delete in the console whenever the user has delete permission, regardless of whether the campaign is draft, in progress, or completed. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
@@ -205,12 +205,6 @@ func (s *Service) DeleteCampaign(
|
||||
return fmt.Errorf("cannot load campaign: %w", err)
|
||||
}
|
||||
|
||||
if campaign.Status != coredata.AccessReviewCampaignStatusDraft &&
|
||||
campaign.Status != coredata.AccessReviewCampaignStatusCancelled &&
|
||||
campaign.Status != coredata.AccessReviewCampaignStatusCompleted {
|
||||
return NewCampaignNotDeletableError(campaign.ID)
|
||||
}
|
||||
|
||||
if err := campaign.Delete(ctx, conn, scope); err != nil {
|
||||
return fmt.Errorf("cannot delete campaign: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user