You are here

public function Php::access in PHP 8

Same name in this branch
  1. 8 src/Plugin/views/argument_default/Php.php \Drupal\php\Plugin\views\argument_default\Php::access()
  2. 8 src/Plugin/views/argument_validator/Php.php \Drupal\php\Plugin\views\argument_validator\Php::access()

Permissions check.

Only let users with PHP block visibility permissions set/modify this default plugin.

Overrides ArgumentDefaultPluginBase::access

File

src/Plugin/views/argument_default/Php.php, line 51

Class

Php
Default argument plugin to provide a PHP code block.

Namespace

Drupal\php\Plugin\views\argument_default

Code

public function access() {
  return \Drupal::currentUser()
    ->hasPermission('use PHP for settings');
}