Hide unpublished and hidden docs in Slack alert

The trust center access-request Slack notification listed every document
referenced by a document access, including drafts with no published
version and documents whose trust center visibility is NONE. Skip those
so the message only surfaces documents a requester could actually be
granted.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
Sacha Al Himdani
2026-07-06 18:41:10 +02:00
parent 3443e63184
commit cdd3af635b

View File

@@ -354,6 +354,10 @@ func (s *Service) loadDocumentsReportsAndFilesFromAccesses(
return nil, nil, nil, fmt.Errorf("cannot load document: %w", err)
}
if doc.CurrentPublishedMajor == nil || doc.TrustCenterVisibility == coredata.TrustCenterVisibilityNone {
continue
}
documents = append(
documents,
SlackMessageDocument{