You are here

public function CasProtectedUserFieldConstraintValidator::__construct in CAS 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Validation/Constraint/CasProtectedUserFieldConstraintValidator.php \Drupal\cas\Plugin\Validation\Constraint\CasProtectedUserFieldConstraintValidator::__construct()

Constructs the object.

Parameters

\Drupal\user\UserStorageInterface $user_storage: The user storage handler.

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

\Drupal\cas\Service\CasUserManager $cas_user_manager: The CAS user manager.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

Overrides ProtectedUserFieldConstraintValidator::__construct

File

src/Plugin/Validation/Constraint/CasProtectedUserFieldConstraintValidator.php, line 44

Class

CasProtectedUserFieldConstraintValidator
Decorates the ProtectedUserFieldConstraint constraint.

Namespace

Drupal\cas\Plugin\Validation\Constraint

Code

public function __construct(UserStorageInterface $user_storage, AccountProxyInterface $current_user, CasUserManager $cas_user_manager, ConfigFactoryInterface $config_factory) {
  parent::__construct($user_storage, $current_user);
  $this->casUserManager = $cas_user_manager;
  $this->restrictedPasswordManagement = (bool) $config_factory
    ->get('cas.settings')
    ->get('user_accounts.restrict_password_management');
}