You are here

public function ExternalSettingsJsController::access in External Links 8

Checks access external extlink JS file.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

1 string reference to 'ExternalSettingsJsController::access'
extlink.routing.yml in ./extlink.routing.yml
extlink.routing.yml

File

src/Controller/ExternalSettingsJsController.php, line 63

Class

ExternalSettingsJsController
Provides an external endpoint from which extlink settings JS can be loaded.

Namespace

Drupal\extlink\Controller

Code

public function access() {

  // Access is strictly controlled by whether module is configured to use an
  // external JS file.
  $config = $this->configFactory
    ->get('extlink.settings');
  return AccessResult::allowedIf($config
    ->get('extlink_use_external_js_file'))
    ->addCacheableDependency($config);
}