From 8677dd48ad161c4e8ffd62732d2c2f89f65d0d66 Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 19 Sep 2018 14:18:52 +0300 Subject: [PATCH] Bug fixes for portal user limit --- application/Espo/Services/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/Espo/Services/User.php b/application/Espo/Services/User.php index a98d7db3c8..82dbc4e8d6 100644 --- a/application/Espo/Services/User.php +++ b/application/Espo/Services/User.php @@ -331,7 +331,7 @@ class User extends Record protected function beforeCreateEntity(Entity $entity, $data) { - if ($this->getConfig()->get('userLimit') && !$this->getUser()->get('isSuperAdmin')) { + if ($this->getConfig()->get('userLimit') && !$this->getUser()->get('isSuperAdmin') && !$entity->get('isPortalUser')) { $userCount = $this->getInternalUserCount(); if ($userCount >= $this->getConfig()->get('userLimit')) { throw new Forbidden('User limit '.$this->getConfig()->get('userLimit').' is reached.');