You are here

public function DynamicLayoutController::access in Dynamic Layouts 8

Checks access to add a new layout.

1 string reference to 'DynamicLayoutController::access'
dynamic_layouts.routing.yml in ./dynamic_layouts.routing.yml
dynamic_layouts.routing.yml

File

src/Controller/DynamicLayoutController.php, line 71

Class

DynamicLayoutController
DynamicLayoutController class.

Namespace

Drupal\dynamic_layouts\Controller

Code

public function access() {
  $settings_created = FALSE;

  /** @var \Drupal\dynamic_layouts\DynamicLayoutSettingsInterface $settings */
  if (($settings = $this->entityTypeManager
    ->getStorage('dynamic_layout_settings')
    ->load('settings')) && $settings
    ->getFrontendLibrary()) {
    $settings_created = TRUE;
  }
  return AccessResult::allowedIf($settings_created);
}