Skip to content
Snippets Groups Projects

1.x

Open Matthew Grasmick requested to merge issue/acquia_optimize-3517839:1.x into 1.x
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
126 try {
127 const response = await fetch('/acquia-optimize/api/settings', {
128 method: 'GET',
129 credentials: 'same-origin',
130 headers: {
131 'Accept': 'application/json',
132 }
133 });
134
135 if (response.ok) {
136 const data = await response.json();
137 setCanConfigure(!!data.can_configure);
138 setCanScan(!!data.can_scan);
139
140 // If user doesn't have permission to scan or configure, don't proceed further
141 if (!data.can_scan && !data.can_configure) {
  • Matt Glaman added 1 commit

    added 1 commit

    Compare with previous version

  • 56 );
    57 }
    58
    59 /**
    60 * Gets the Acquia Optimize settings.
    61 *
    62 * @return \Symfony\Component\HttpFoundation\JsonResponse
    63 * The JSON response containing settings.
    64 */
    65 public function getSettings(): JsonResponse {
    66 $config = $this->configFactory->get('acquia_optimize.settings');
    67 $hasAdminPermission = $this->currentUser()->hasPermission('administer acquia optimize');
    68 $hasScanPermission = $this->currentUser()->hasPermission('scan acquia optimize');
    69
    70 $settings = [
    71 'api_key' => $config->get('api_key') ? ($hasAdminPermission ? $config->get('api_key') : '[API key set]') : '',
  • Matt Glaman added 1 commit

    added 1 commit

    • 5d22915f - provide internal API endpoints for calling the external API

    Compare with previous version

  • Matt Glaman added 2 commits

    added 2 commits

    • ff9c2b84 - never bubble api key to client
    • 38ac7f5c - fix default accessibility

    Compare with previous version

  • Please register or sign in to reply
    Loading