From 8564adca6a59a60f070701477e60d88f347a1a32 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 18 May 2018 11:37:05 +0300 Subject: [PATCH] fix portal assinment permission --- application/Espo/Services/Record.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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'])) {