Merge pull request #18723 from colemanw/crmSearchCleanup
[civicrm-core.git] / Civi / Api4 / Action / GetActions.php
index fbab1f057db8e3bc15749372b2b02e13dc50c241..66b8966ade869dd3241bd7c3bfa61c49ea5e8a05 100644 (file)
@@ -33,7 +33,7 @@ class GetActions extends BasicGetAction {
     $entityReflection = new \ReflectionClass('\Civi\Api4\\' . $this->_entityName);
     foreach ($entityReflection->getMethods(\ReflectionMethod::IS_STATIC | \ReflectionMethod::IS_PUBLIC) as $method) {
       $actionName = $method->getName();
-      if ($actionName != 'permissions' && $actionName[0] != '_') {
+      if ($actionName != 'permissions' && $actionName != 'getInfo' && $actionName[0] != '_') {
         $this->loadAction($actionName, $method);
       }
     }
@@ -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];