From 2fbd28ad24419f2f3b192adb1265215064e0b422 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 14 Jul 2023 16:24:03 +1000 Subject: [PATCH] [REF] Ensure that getActions respects any modifications by event listerners modifying permissions --- Civi/Api4/Action/GetActions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Civi/Api4/Action/GetActions.php b/Civi/Api4/Action/GetActions.php index b88db07ca4..1705a10b26 100644 --- a/Civi/Api4/Action/GetActions.php +++ b/Civi/Api4/Action/GetActions.php @@ -79,7 +79,8 @@ class GetActions extends BasicGetAction { try { if (!isset($this->_actions[$actionName]) && (!$this->_actionsToGet || in_array($actionName, $this->_actionsToGet))) { $action = \Civi\API\Request::create($this->getEntityName(), $actionName, ['version' => 4]); - if (is_object($action) && (!$this->checkPermissions || $action->isAuthorized(\CRM_Core_Session::singleton()->getLoggedInContactID()))) { + $authorized = \Civi::service('civi_api_kernel')->runAuthorize($this->getEntityName(), $actionName, ['version' => 4]); + if (is_object($action) && (!$this->checkPermissions || $authorized)) { $this->_actions[$actionName] = ['name' => $actionName]; if ($this->_isFieldSelected('description', 'comment', 'see')) { $vars = ['entity' => $this->getEntityName(), 'action' => $actionName]; -- 2.25.1