You are here

public function Security::__construct in Bamboo Twig 8

TwigExtension constructor class.

Parameters

\Drupal\Core\Session\AccountInterface $currentUser: The current user.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity: The Entity type manager service.

File

bamboo_twig_security/src/TwigExtension/Security.php, line 35

Class

Security
Provides a 'Security' Twig Extensions.

Namespace

Drupal\bamboo_twig_security\TwigExtension

Code

public function __construct(AccountInterface $currentUser, EntityTypeManagerInterface $entity) {
  $this->currentUser = $currentUser;
  $this->userStorage = $entity
    ->getStorage('user');
}