You are here

function _tracker_myrecent_access in Drupal 8

Same name and namespace in other branches
  1. 6 modules/tracker/tracker.module \_tracker_myrecent_access()
  2. 7 modules/tracker/tracker.module \_tracker_myrecent_access()

Access callback: Determines access permission for a user's own account.

@internal

Parameters

\Drupal\Core\Session\AccountInterface $account: The user account to track.

Return value

bool TRUE if a user is accessing tracking info for their own account and has permission to access the content.

Deprecated

in drupal:8.4.0 and is removed from drupal:9.0.0. As internal API, _tracker_user_access() may also be removed in a minor release.

File

core/modules/tracker/tracker.module, line 155
Tracks recent content posted by a user or users.

Code

function _tracker_myrecent_access(AccountInterface $account) {
  @trigger_error('_tracker_myrecent_access() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.', E_USER_DEPRECATED);

  // This path is only allowed for authenticated users looking at their own content.
  return $account
    ->id() && \Drupal::currentUser()
    ->id() == $account
    ->id() && $account
    ->hasPermission('access content');
}