function HandlerBase::access

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/HandlerBase.php \Drupal\views\Plugin\views\HandlerBase::access()
  2. 10 core/modules/views/src/Plugin/views/HandlerBase.php \Drupal\views\Plugin\views\HandlerBase::access()
  3. 11.x core/modules/views/src/Plugin/views/HandlerBase.php \Drupal\views\Plugin\views\HandlerBase::access()

Overrides ViewsHandlerInterface::access

4 methods override HandlerBase::access()
EntityField::access in core/modules/views/src/Plugin/views/field/EntityField.php
Check whether given user has access to this handler.
NodeCounterTimestamp::access in core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php
Check whether given user has access to this handler.
StatisticsNumeric::access in core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php
Check whether given user has access to this handler.
TestExample::access in core/modules/views/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php
Check whether given user has access to this handler.

File

core/modules/views/src/Plugin/views/HandlerBase.php, line 465

Class

HandlerBase
Base class for Views handler plugins.

Namespace

Drupal\views\Plugin\views

Code

public function access(AccountInterface $account) {
    if (isset($this->definition['access callback']) && function_exists($this->definition['access callback'])) {
        if (isset($this->definition['access arguments']) && is_array($this->definition['access arguments'])) {
            return call_user_func_array($this->definition['access callback'], [
                $account,
            ] + $this->definition['access arguments']);
        }
        return $this->definition['access callback']($account);
    }
    return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.