You are here

public function Masquerade::__construct in Masquerade 8.2

Constructs Masquerade object.

Parameters

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

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

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Session\SessionManagerInterface $session_manager: The session manager.

\Symfony\Component\HttpFoundation\Session\SessionInterface $session: The session.

\Psr\Log\LoggerInterface $logger: The logger instance.

\Drupal\user\PermissionHandlerInterface $permission_handler: The permission handler.

File

src/Masquerade.php, line 88

Class

Masquerade
Defines a masquerade service to switch user account.

Namespace

Drupal\masquerade

Code

public function __construct(AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, SessionManagerInterface $session_manager, SessionInterface $session, LoggerInterface $logger, PermissionHandlerInterface $permission_handler) {
  $this->currentUser = $current_user;
  $this->userStorage = $entity_type_manager
    ->getStorage('user');
  $this->moduleHandler = $module_handler;
  $this->sessionManager = $session_manager;
  $this->logger = $logger;
  $this->permissionHandler = $permission_handler;
  $this->session = $session;
}