Skip to content

EspoCRM – Open Source CRM Application

Get folder list fix

Yurii0f9ebf26271d
diff --git a/application/Espo/Core/Mail/Account/PersonalAccount/Service.php b/application/Espo/Core/Mail/Account/PersonalAccount/Service.php
index a915d9bd1f..5de3192ed6 100644
--- a/application/Espo/Core/Mail/Account/PersonalAccount/Service.php
+++ b/application/Espo/Core/Mail/Account/PersonalAccount/Service.php
@@ -111,6 +111,13 @@ class Service
if ($params->getId()) {
$account = $this->accountFactory->create($params->getId());
+ if (
+ !$this->user->isAdmin() &&
+ $account->getUser()->getId() !== $this->user->getId()
+ ) {
+ throw new Forbidden();
+ }
+
$params = $params
->withPassword($this->getPassword($params, $account))
->withImapHandlerClassName($account->getImapHandlerClassName());