fix stream

This commit is contained in:
Yuri Kuznetsov
2019-11-18 16:00:31 +02:00
parent eac8ce736c
commit 83bd4458a2
+8 -10
View File
@@ -406,7 +406,8 @@ class Stream extends \Espo\Core\Services\Base
],
];
if ($this->getUserAclManager($user)->check($user, 'Email', 'read')) {
$aclManager = $this->getUserAclManager($user);
if ($aclManager && $aclManager->check($user, 'Email', 'read')) {
$selectParamsSubscription['leftJoins'][] = [
'noteUser', 'noteUser', [
'noteUser.noteId=:' => 'id',
@@ -1682,6 +1683,12 @@ class Stream extends \Espo\Core\Services\Base
if ($user->isPortal() && !$this->getUser()->isPortal()) {
$aclManager = new \Espo\Core\Portal\AclManager($this->getInjection('container'));
$portals = $user->get('portals');
if (count($portals)) {
$aclManager->setPortal($portals[0]);
} else {
$aclManager = null;
}
}
return $aclManager;
@@ -1715,15 +1722,6 @@ class Stream extends \Espo\Core\Services\Base
$aclManager = $this->getUserAclManager($user);
if ($user->isPortal() && !$this->getUser()->isPortal()) {
$portals = $user->get('portals');
if (count($portals)) {
$aclManager->setPortal($portals[0]);
} else {
$aclManager = null;
}
}
foreach ($scopes as $scope => $item) {
if (empty($item['entity'])) continue;
if (empty($item['object'])) continue;