You are here

public function Masquerade::isMasquerading in Masquerade 8.2

Returns whether the current user is masquerading.

Return value

bool TRUE when already masquerading, FALSE otherwise.

File

src/Masquerade.php, line 135

Class

Masquerade
Defines a masquerade service to switch user account.

Namespace

Drupal\masquerade

Code

public function isMasquerading() {

  // Do not start new session trying to access its attributes.
  return $this->session
    ->isStarted() && $this->session
    ->has('masquerading');
}