readOnly take into account entityDefs links

This commit is contained in:
Yuri Kuznetsov
2022-07-13 12:42:57 +03:00
parent 4715350d7c
commit 5e877a8a8b
@@ -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;
}