function TrackerController::checkAccess

Same name in other branches
  1. 8.9.x core/modules/tracker/src/Controller/TrackerController.php \Drupal\tracker\Controller\TrackerController::checkAccess()
  2. 10 core/modules/tracker/src/Controller/TrackerController.php \Drupal\tracker\Controller\TrackerController::checkAccess()
  3. 11.x core/modules/tracker/src/Controller/TrackerController.php \Drupal\tracker\Controller\TrackerController::checkAccess()

Checks access for the users recent content tracker page.

Parameters

\Drupal\user\UserInterface $user: The user being viewed.

\Drupal\Core\Session\AccountInterface $account: The account viewing the page.

Return value

\Drupal\Core\Access\AccessResult The access result.

1 string reference to 'TrackerController::checkAccess'
tracker.routing.yml in core/modules/tracker/tracker.routing.yml
core/modules/tracker/tracker.routing.yml

File

core/modules/tracker/src/Controller/TrackerController.php, line 117

Class

TrackerController
Controller for tracker pages.

Namespace

Drupal\tracker\Controller

Code

public function checkAccess(UserInterface $user, AccountInterface $account) {
    return AccessResult::allowedIf($account->isAuthenticated() && $user->id() == $account->id())
        ->cachePerUser();
}

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