Cancel signature requests on deactivation
Disabling a profile now removes pending document signature requests tied to that signatory. This keeps inactive accounts from retaining signature work across manual, archived, and SCIM deactivation flows. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
committed by
Bryan Frimin
parent
122bc02a23
commit
f7309c642a
@@ -425,6 +425,11 @@ func (s *OrganizationService) ArchiveUser(
|
||||
return fmt.Errorf("cannot expire pending invitations: %w", err)
|
||||
}
|
||||
|
||||
signatures := &coredata.DocumentVersionSignatures{}
|
||||
if err := signatures.DeleteRequestedBySignatory(ctx, tx, scope, profile.ID); err != nil {
|
||||
return fmt.Errorf("cannot delete requested signatures: %w", err)
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
if profile.State != coredata.ProfileStateInactive {
|
||||
@@ -1161,6 +1166,13 @@ func (s *OrganizationService) UpdateUserState(
|
||||
return fmt.Errorf("cannot update profile: %w", err)
|
||||
}
|
||||
|
||||
if state == coredata.ProfileStateInactive {
|
||||
signatures := &coredata.DocumentVersionSignatures{}
|
||||
if err := signatures.DeleteRequestedBySignatory(ctx, tx, scope, profile.ID); err != nil {
|
||||
return fmt.Errorf("cannot delete requested signatures: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user