From 7649f4d680710b8ccfc7166e6dc242a2ed514d92 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 23 Jan 2017 13:27:59 +0200 Subject: [PATCH] user acl fixes --- application/Espo/SelectManagers/User.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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);