You are here

public function StaticTest::access in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php \Drupal\views_test_data\Plugin\views\access\StaticTest::access()
  2. 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php \Drupal\views_test_data\Plugin\views\access\StaticTest::access()

Determine if the current user has access or not.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user who wants to access this view.

Return value

bool Returns whether the user has access to the view.

Overrides AccessPluginBase::access

File

core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php, line 30

Class

StaticTest
Tests a static access plugin.

Namespace

Drupal\views_test_data\Plugin\views\access

Code

public function access(AccountInterface $account) {
  return !empty($this->options['access']);
}