From 5e877a8a8b18fe6a1253f430dcca88282d7edd99 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 13 Jul 2022 12:42:57 +0300 Subject: [PATCH] readOnly take into account entityDefs links --- application/Espo/Core/Acl/GlobalRestriction.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/application/Espo/Core/Acl/GlobalRestriction.php b/application/Espo/Core/Acl/GlobalRestriction.php index fbdb1158a7..0407b5fc5c 100644 --- a/application/Espo/Core/Acl/GlobalRestriction.php +++ b/application/Espo/Core/Acl/GlobalRestriction.php @@ -189,12 +189,21 @@ class GlobalRestriction $resultLinkList = []; foreach ($linkList as $link) { - if ($this->metadata->get(['entityAcl', $scope, 'links', $link, $type])) { - $isNotEmpty = true; + $value = $this->metadata->get(['entityAcl', $scope, 'links', $link, $type]); - $resultLinkList[] = $link; + if (!$value && in_array($type, $this->entityDefsTypeList)) { + $value = $this->metadata->get(['entityDefs', $scope, 'links', $link, $type]); } + + if (!$value) { + continue; + } + + $isNotEmpty = true; + + $resultLinkList[] = $link; } + $scopeData->links->$type = $resultLinkList; }