You are here

public function DisplayPluginBase::access in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::access()

Determines if the user has access to this display of the view.

Overrides DisplayPluginInterface::access

1 call to DisplayPluginBase::access()
Attachment::attachTo in core/modules/views/src/Plugin/views/display/Attachment.php
Allows displays to attach to other views.

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 2312

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function access(AccountInterface $account = NULL) {
  if (!isset($account)) {
    $account = \Drupal::currentUser();
  }
  $plugin = $this
    ->getPlugin('access');

  /** @var \Drupal\views\Plugin\views\access\AccessPluginBase $plugin */
  if ($plugin) {
    return $plugin
      ->access($account);
  }

  // Fallback to all access if no plugin.
  return TRUE;
}