diff --git a/application/Espo/Core/Acl.php b/application/Espo/Core/Acl.php index 5ce63e7397..6fe1903101 100644 --- a/application/Espo/Core/Acl.php +++ b/application/Espo/Core/Acl.php @@ -153,31 +153,39 @@ class Acl /** * Get attributes forbidden for a user. */ - public function getScopeForbiddenAttributeList(string $scope, string $action = 'read', string $thresholdLevel = 'no') : array - { - return $this->getAclManager()->getScopeForbiddenAttributeList($this->getUser(), $scope, $action, $thresholdLevel); + public function getScopeForbiddenAttributeList( + string $scope, string $action = 'read', string $thresholdLevel = 'no' + ) : array { + + return $this->getAclManager() + ->getScopeForbiddenAttributeList($this->getUser(), $scope, $action, $thresholdLevel); } /** * Get fields forbidden for a user. */ - public function getScopeForbiddenFieldList(string $scope, string $action = 'read', string $thresholdLevel = 'no') : array - { - return $this->getAclManager()->getScopeForbiddenFieldList($this->getUser(), $scope, $action, $thresholdLevel); + public function getScopeForbiddenFieldList( + string $scope, string $action = 'read', string $thresholdLevel = 'no' + ) : array { + + return $this->getAclManager() + ->getScopeForbiddenFieldList($this->getUser(), $scope, $action, $thresholdLevel); } /** * Get links forbidden for a user. */ - public function getScopeForbiddenLinkList(string $scope, string $action = 'read', string $thresholdLevel = 'no') : array - { + public function getScopeForbiddenLinkList( + string $scope, string $action = 'read', string $thresholdLevel = 'no' + ) : array { + return $this->getAclManager()->getScopeForbiddenLinkList($this->getUser(), $scope, $action, $thresholdLevel); } /** * Whether a user has an access to another user over a specific permission. * - * @param $target User|string User entity or user ID. + * @param User|string $target User entity or user ID. */ public function checkUserPermission($target, string $permissionType = 'user') : bool { @@ -187,7 +195,7 @@ class Acl /** * Whether a user can assign to another user. * - * @param $target User|string User entity or user ID. + * @param User|string $target User entity or user ID. */ public function checkAssignmentPermission($target) : bool { diff --git a/application/Espo/Core/AclManager.php b/application/Espo/Core/AclManager.php index c9ed5c6531..ffda3d7aac 100644 --- a/application/Espo/Core/AclManager.php +++ b/application/Espo/Core/AclManager.php @@ -396,7 +396,7 @@ class AclManager /** * Whether a user has an access to another user over a specific permission. * - * @param $target User|string User entity or user ID. + * @param User|string $target User entity or user ID. */ public function checkUserPermission(User $user, $target, string $permissionType = 'user') : bool { @@ -434,7 +434,7 @@ class AclManager /** * Whether a user can assign to another user. * - * @param $target User|string User entity or user ID. + * @param User|string $target User entity or user ID. */ public function checkAssignmentPermission(User $user, $target) : bool { @@ -466,6 +466,7 @@ class AclManager return $list; } + return $this->globalRestricton->getScopeRestrictedFieldList($scope, $type); }