_tracker_myrecent_access

_tracker_myrecent_access(AccountInterface $account)

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

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.

See also

tracker_menu()

File

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

Code

function _tracker_myrecent_access(AccountInterface $account) {
  // 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');
}
doc_Drupal
2016-10-29 09:57:20
Comments
Leave a Comment

Please login to continue.