You are here

public function DefaultAccess::access in Panelizer 8.4

Same name and namespace in other branches
  1. 8.5 src/Access/DefaultAccess.php \Drupal\panelizer\Access\DefaultAccess::access()
  2. 8.3 src/Access/DefaultAccess.php \Drupal\panelizer\Access\DefaultAccess::access()

Determines access to a default Panelizer layout.

Parameters

string $entity_type_id: The panelized entity type ID.

string $bundle: The panelized bundle ID.

string $view_mode_name: The panelized view mode ID.

Return value

\Drupal\Core\Access\AccessResult

File

src/Access/DefaultAccess.php, line 43

Class

DefaultAccess

Namespace

Drupal\panelizer\Access

Code

public function access($entity_type_id, $bundle, $view_mode_name) {
  $settings = $this->panelizer
    ->getPanelizerSettings($entity_type_id, $bundle, $view_mode_name);
  return $settings['enable'] ? AccessResult::allowed() : AccessResult::forbidden();
}