From a401c4cd4c13356da3dd2ffd36ebad4a6eb2fd28 Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 3 Dec 2015 15:34:59 +0200 Subject: [PATCH] set is fetched --- application/Espo/Core/Acl/Table.php | 2 +- application/Espo/Services/Notification.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/application/Espo/Core/Acl/Table.php b/application/Espo/Core/Acl/Table.php index 692de16f31..10c0ceeefd 100644 --- a/application/Espo/Core/Acl/Table.php +++ b/application/Espo/Core/Acl/Table.php @@ -56,7 +56,7 @@ class Table $this->metadata = $metadata; if (!$this->user->isFetched()) { - //throw new Error(); + throw new Error('User must be fetched before ACL check.'); } $this->user->loadLinkMultipleField('teams'); diff --git a/application/Espo/Services/Notification.php b/application/Espo/Services/Notification.php index 874cb5a7e6..a502c994f2 100644 --- a/application/Espo/Services/Notification.php +++ b/application/Espo/Services/Notification.php @@ -91,6 +91,7 @@ class Notification extends \Espo\Core\Services\Base $user = $this->getEntityManager()->getEntity('User'); $user->id = $userId; + $user->setAsFetched(); if (!$this->checkUserNoteAccess($user, $note)) { continue; }