protected function checkUserIsPermitted($user)
    {
        if (!isset($user)) {
            Log::debug("Login failed for ".$user[$this->usernameColumnName]." - the user is disabled.", "LOGIN");
            throw new LoginDisabledException();
        }

        if ($this->hasPasswordExpired($user)){
            Log::debug("Login failed for ".$user[$this->usernameColumnName]." - the password has expired.", "LOGIN");
            throw new LoginExpiredException();
        }

        if ($this->isUserTemporarilyLockedOut($user)){
            Log::debug("Login failed for ".$user[$this->usernameColumnName]." - the user is temporarily disabled.", "LOGIN");
            throw new LoginTemporarilyLockedOutException();
        }
    }