You are here

protected function BasicOverview::canPerformReset in Two-factor Authentication (TFA) 8

Determine if the current user can perform a TFA attempt reset.

Parameters

\Drupal\user\UserInterface $account: The account that TFA is for.

Return value

bool Whether the user can perform a TFA reset.

1 call to BasicOverview::canPerformReset()
BasicOverview::buildForm in src/Form/BasicOverview.php
Form constructor.

File

src/Form/BasicOverview.php, line 286

Class

BasicOverview
TFA Basic account setup overview page.

Namespace

Drupal\tfa\Form

Code

protected function canPerformReset(UserInterface $account) {
  $current_user = $this
    ->currentUser();
  return $current_user
    ->hasPermission('administer users') && $current_user
    ->id() != $account
    ->id();
}