You are here

public function PanelsDisplayVariant::access in Panels 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/DisplayVariant/PanelsDisplayVariant.php \Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant::access()

Determines if this display variant is accessible.

Parameters

\Drupal\Core\Session\AccountInterface $account: (optional) The user for which to check access, or NULL to check access for the current user. Defaults to NULL.

Return value

bool TRUE if this display variant is accessible, FALSE otherwise.

Overrides VariantBase::access

File

src/Plugin/DisplayVariant/PanelsDisplayVariant.php, line 383

Class

PanelsDisplayVariant
Provides a display variant that simply contains blocks.

Namespace

Drupal\panels\Plugin\DisplayVariant

Code

public function access(AccountInterface $account = NULL) {

  // If no blocks are configured for this variant, deny access.
  if (empty($this->configuration['blocks'])) {
    return FALSE;
  }
  return parent::access($account);
}