You are here

public function ContentAccess::getCurrentUser in Search API 8

Retrieves the current user.

Return value

\Drupal\Core\Session\AccountProxyInterface The current user.

1 call to ContentAccess::getCurrentUser()
ContentAccess::preprocessSearchQuery in src/Plugin/search_api/processor/ContentAccess.php
Preprocesses a search query.

File

src/Plugin/search_api/processor/ContentAccess.php, line 97

Class

ContentAccess
Adds content access checks for nodes and comments.

Namespace

Drupal\search_api\Plugin\search_api\processor

Code

public function getCurrentUser() {
  return $this->currentUser ?: \Drupal::currentUser();
}