You are here

public function TrackerController::checkAccess in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/tracker/src/Controller/TrackerController.php \Drupal\tracker\Controller\TrackerController::checkAccess()
  2. 9 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();
}