function 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 2343  
Class
- DisplayPluginBase
 - Base class for views display plugins.
 
Namespace
Drupal\views\Plugin\views\displayCode
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.