From b70327874e823d4265388dfd9fa389ec8c77d3d6 Mon Sep 17 00:00:00 2001 From: Arkadiy Asuratov Date: Wed, 29 Mar 2023 10:24:22 +0200 Subject: [PATCH] ensure notes by portal users are always public (#2681) --- application/Espo/Services/Note.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/Espo/Services/Note.php b/application/Espo/Services/Note.php index 0d904bc1e4..35b0e06d32 100644 --- a/application/Espo/Services/Note.php +++ b/application/Espo/Services/Note.php @@ -119,6 +119,10 @@ class Note extends Record throw new ForbiddenSilent("Only 'Post' type allowed."); } + if ($this->user->isPortal()) { + $entity->set('isInternal', false); + } + if ($entity->isPost()) { $this->handlePostText($entity); }