You are here

protected function TwigExtensionBase::getCurrentUser in Bamboo Twig 8.3

Same name and namespace in other branches
  1. 8.5 src/TwigExtension/TwigExtensionBase.php \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase::getCurrentUser()
  2. 8.2 src/TwigExtension/TwigExtensionBase.php \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase::getCurrentUser()
  3. 8.4 src/TwigExtension/TwigExtensionBase.php \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase::getCurrentUser()

Lazy loading for the Drupal current user account proxy.

Return value

\Drupal\Core\Session\AccountInterface Return The current user account proxy.

3 calls to TwigExtensionBase::getCurrentUser()
Loader::loadCurrentUser in bamboo_twig_loader/src/TwigExtension/Loader.php
Return the current user object.
Security::hasPermission in bamboo_twig_security/src/TwigExtension/Security.php
Does the current|given user has the given permission ?
Security::hasRole in bamboo_twig_security/src/TwigExtension/Security.php
Does the current|given user has the given permission ?

File

src/TwigExtension/TwigExtensionBase.php, line 107

Class

TwigExtensionBase
Provides a Twig Extension Lazy Service Injection.

Namespace

Drupal\bamboo_twig\TwigExtension

Code

protected function getCurrentUser() {
  return $this->container
    ->get('current_user');
}