You are here

protected function EntityAccessControlHandler::prepareUser in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php \Drupal\Core\Entity\EntityAccessControlHandler::prepareUser()

Loads the current account object, if it does not exist yet.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account interface instance.

Return value

\Drupal\Core\Session\AccountInterface Returns the current account object.

5 calls to EntityAccessControlHandler::prepareUser()
EntityAccessControlHandler::access in core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
Checks access to an operation on a given entity or entity translation.
EntityAccessControlHandler::createAccess in core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
Checks access to create an entity.
EntityAccessControlHandler::fieldAccess in core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
Checks access to an operation on a given entity field.
NodeAccessControlHandler::access in core/modules/node/src/NodeAccessControlHandler.php
Checks access to an operation on a given entity or entity translation.
NodeAccessControlHandler::createAccess in core/modules/node/src/NodeAccessControlHandler.php
Checks access to create an entity.

File

core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php, line 279
Contains \Drupal\Core\Entity\EntityAccessControlHandler.

Class

EntityAccessControlHandler
Defines a default implementation for entity access control handler.

Namespace

Drupal\Core\Entity

Code

protected function prepareUser(AccountInterface $account = NULL) {
  if (!$account) {
    $account = \Drupal::currentUser();
  }
  return $account;
}