Merge pull request #18723 from colemanw/crmSearchCleanup
[civicrm-core.git] / Civi / Api4 / Action / GetActions.php
index 6ef4f3f52287cdf590cdbc9b9eb48eb2697cf29e..66b8966ade869dd3241bd7c3bfa61c49ea5e8a05 100644 (file)
@@ -75,7 +75,7 @@ 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)) {
+        if (is_object($action) && (!$this->checkPermissions || $action->isAuthorized())) {
           $this->_actions[$actionName] = ['name' => $actionName];
           if ($this->_isFieldSelected('description', 'comment', 'see')) {
             $vars = ['entity' => $this->getEntityName(), 'action' => $actionName];