diff --git a/application/Espo/Services/Record.php b/application/Espo/Services/Record.php index e0c054dc0e..ea95377506 100644 --- a/application/Espo/Services/Record.php +++ b/application/Espo/Services/Record.php @@ -1975,6 +1975,10 @@ class Record implements Crud, throw new Forbidden("No 'read' access to user."); } + if ($user->isPortal() && !$this->getAcl()->get('portal')) { + throw new Forbidden("No 'portal' permission."); + } + $result = $this->getStreamService()->followEntity($entity, $foreignId); if (!$result) { @@ -2012,11 +2016,14 @@ class Record implements Crud, throw new Forbidden("No 'read' access to user."); } + if ($user->isPortal() && !$this->getAcl()->get('portal')) { + throw new Forbidden("No 'portal' permission."); + } + if (!$this->getUser()->isAdmin()) { throw new Forbidden(); } - $this->getStreamService()->unfollowEntity($entity, $foreignId); }