You are here

class ViewOwnTrackerAccessCheck in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/tracker/src/Access/ViewOwnTrackerAccessCheck.php \Drupal\tracker\Access\ViewOwnTrackerAccessCheck

Access check for user tracker routes.

Hierarchy

Expanded class hierarchy of ViewOwnTrackerAccessCheck

1 string reference to 'ViewOwnTrackerAccessCheck'
tracker.services.yml in core/modules/tracker/tracker.services.yml
core/modules/tracker/tracker.services.yml
1 service uses ViewOwnTrackerAccessCheck
access_check.tracker.view_own in core/modules/tracker/tracker.services.yml
Drupal\tracker\Access\ViewOwnTrackerAccessCheck

File

core/modules/tracker/src/Access/ViewOwnTrackerAccessCheck.php, line 18
Contains \Drupal\tracker\Access\ViewOwnTrackerAccessCheck.

Namespace

Drupal\tracker\Access
View source
class ViewOwnTrackerAccessCheck implements AccessInterface {

  /**
   * Checks access.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The currently logged in account.
   * @param \Drupal\user\UserInterface $user
   *   The user whose tracker page is being accessed.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result.
   */
  public function access(AccountInterface $account, UserInterface $user) {
    return AccessResult::allowedIf($user && $account
      ->isAuthenticated() && $user
      ->id() == $account
      ->id())
      ->cachePerUser();
  }

}

Members