From 767e775f31ee5d055fc92b603d10aff1a53569b0 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 27 May 2022 11:50:51 +0300 Subject: [PATCH 1/2] fix mass convert currency --- .../Core/MassAction/Actions/MassConvertCurrency.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/application/Espo/Core/MassAction/Actions/MassConvertCurrency.php b/application/Espo/Core/MassAction/Actions/MassConvertCurrency.php index 5ff3cb78c8..f2f1877c7b 100644 --- a/application/Espo/Core/MassAction/Actions/MassConvertCurrency.php +++ b/application/Espo/Core/MassAction/Actions/MassConvertCurrency.php @@ -31,6 +31,8 @@ namespace Espo\Core\MassAction\Actions; use Espo\Entities\User; +use Espo\Core\Acl\Table; + use Espo\Core\{ Exceptions\Forbidden, Exceptions\BadRequest, @@ -93,11 +95,11 @@ class MassConvertCurrency implements MassAction { $entityType = $params->getEntityType(); - if (!$this->acl->check($entityType, 'delete')) { - throw new Forbidden("No delete access for '{$entityType}'."); + if (!$this->acl->checkScope($entityType, Table::ACTION_EDIT)) { + throw new Forbidden("No edit access for '{$entityType}'."); } - if ($this->acl->get('massUpdatePermission') !== 'yes') { + if ($this->acl->get('massUpdatePermission') !== Table::LEVEL_YES) { throw new Forbidden("No mass-update permission."); } @@ -142,7 +144,7 @@ class MassConvertCurrency implements MassAction $count = 0; foreach ($collection as $entity) { - if (!$this->acl->checkEntity($entity, 'edit')) { + if (!$this->acl->checkEntity($entity, Table::ACTION_EDIT)) { continue; } From 4f00a18599aa1ed18cd19b922e08672af9faac28 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 29 May 2022 10:34:48 +0300 Subject: [PATCH 2/2] type fixes --- .../Espo/Classes/FieldProcessing/Email/IcsDataLoader.php | 3 +-- application/Espo/Core/Mail/Event/EventFactory.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/application/Espo/Classes/FieldProcessing/Email/IcsDataLoader.php b/application/Espo/Classes/FieldProcessing/Email/IcsDataLoader.php index 68a399c875..d06f4761d3 100644 --- a/application/Espo/Classes/FieldProcessing/Email/IcsDataLoader.php +++ b/application/Espo/Classes/FieldProcessing/Email/IcsDataLoader.php @@ -44,7 +44,6 @@ use Espo\Core\{ }; use ICal\ICal; -use ICal\Event; use Throwable; use stdClass; @@ -85,7 +84,7 @@ class IcsDataLoader implements Loader $ical->initString($icsContents); - /* @var $event Event */ + /* @var \ICal\Event|null $event */ $event = $ical->events()[0] ?? null; if ($event === null) { diff --git a/application/Espo/Core/Mail/Event/EventFactory.php b/application/Espo/Core/Mail/Event/EventFactory.php index 8a972a0cbd..1028c69a1f 100644 --- a/application/Espo/Core/Mail/Event/EventFactory.php +++ b/application/Espo/Core/Mail/Event/EventFactory.php @@ -29,7 +29,6 @@ namespace Espo\Core\Mail\Event; -use ICal\Event as U01jmg3Event; use ICal\ICal as U01jmg3ICal; use RuntimeException; @@ -38,7 +37,7 @@ class EventFactory { public static function createFromU01jmg3Ical(U01jmg3ICal $ical): Event { - /* @var $event U01jmg3Event */ + /* @var \ICal\Event|null $event */ $event = $ical->events()[0] ?? null; if (!$event) {