diff --git a/application/Espo/SelectManagers/User.php b/application/Espo/SelectManagers/User.php index 78ab35cfc3..6aa4d34163 100644 --- a/application/Espo/SelectManagers/User.php +++ b/application/Espo/SelectManagers/User.php @@ -40,6 +40,14 @@ class User extends \Espo\Core\SelectManagers\Base 'isActive' => true ); } + if ($this->getAcl()->get('portalPermission') !== 'yes') { + $result['whereClause'][] = array( + 'OR' => [ + ['isPortalUser' => false], + ['id' => $this->getUser()->id] + ] + ); + } $result['whereClause'][] = array( 'isSuperAdmin' => false ); @@ -91,6 +99,13 @@ class User extends \Espo\Core\SelectManagers\Base ); } + protected function accessPortalOnlyOwn(&$result) + { + $result['whereClause'][] = array( + 'id' => $this->getUser()->id + ); + } + protected function accessOnlyTeam(&$result) { $this->setDistinct(true, $result);