diff --git a/application/Espo/Services/Record.php b/application/Espo/Services/Record.php index 6f8a17ecd6..9ed81420c2 100644 --- a/application/Espo/Services/Record.php +++ b/application/Espo/Services/Record.php @@ -415,6 +415,12 @@ class Record extends \Espo\Core\Services\Base return true; } + if ($this->getUser()->isPortal()) { + if (count($entity->getLinkMultipleIdList('assignedUsers')) === 0) { + return true; + } + } + $assignmentPermission = $this->getAcl()->get('assignmentPermission'); if ($assignmentPermission === true || $assignmentPermission === 'yes' || !in_array($assignmentPermission, ['team', 'no'])) { @@ -472,6 +478,12 @@ class Record extends \Espo\Core\Services\Base $assignedUserId = $entity->get('assignedUserId'); + if ($this->getUser()->isPortal()) { + if (!$entity->isAttributeChanged('assignedUserId') && empty($assignedUserId)) { + return true; + } + } + $assignmentPermission = $this->getAcl()->get('assignmentPermission'); if ($assignmentPermission === true || $assignmentPermission === 'yes' || !in_array($assignmentPermission, ['team', 'no'])) {