diff --git a/CRM/Api4/Page/Api4Explorer.php b/CRM/Api4/Page/Api4Explorer.php index a31e5feb62ec..249991cfeed1 100644 --- a/CRM/Api4/Page/Api4Explorer.php +++ b/CRM/Api4/Page/Api4Explorer.php @@ -22,6 +22,7 @@ class CRM_Api4_Page_Api4Explorer extends CRM_Core_Page { public function run() { $apiDoc = new ReflectionFunction('civicrm_api4'); $groupOptions = civicrm_api4('Group', 'getFields', ['loadOptions' => TRUE, 'select' => ['options', 'name'], 'where' => [['name', 'IN', ['visibility', 'group_type']]]]); + $extensions = \CRM_Extension_System::singleton()->getMapper(); $vars = [ 'operators' => CoreUtil::getOperators(), @@ -30,6 +31,8 @@ public function run() { 'docs' => \Civi\Api4\Utils\ReflectionUtils::parseDocBlock($apiDoc->getDocComment()), 'functions' => self::getSqlFunctions(), 'groupOptions' => array_column((array) $groupOptions, 'options', 'name'), + 'authxEnabled' => $extensions->isActiveModule('authx'), + 'restUrl' => rtrim(CRM_Utils_System::url('civicrm/ajax/api4/CRMAPI4ENTITY/CRMAPI4ACTION', NULL, TRUE, NULL, FALSE), '/'), ]; Civi::resources() ->addVars('api4', $vars) diff --git a/ang/api4Explorer/Explorer.html b/ang/api4Explorer/Explorer.html index a170e2aa847d..a48a68f50aaa 100644 --- a/ang/api4Explorer/Explorer.html +++ b/ang/api4Explorer/Explorer.html @@ -203,6 +203,26 @@
+ {{:: ts('To enable REST authentication, the AuthX extension must be installed.') }} + + {{:: ts('Manage Extensions') }} + +
+