fix stream
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user