class ConsentEndpointAccessCheckerService extends EndpointAccessChecker {

    public boolean isEndpointAccessible(String authorisationId, boolean confirmationCodeReceived) {
        boolean confirmationCodeCase = confirmationCodeReceived
                                           && aspspProfileService.isAuthorisationConfirmationRequestMandated();

        return xs2aAuthorisationService.getAuthorisationById(authorisationId)
                   .map(a -> isAccessible(a.getChosenScaApproach(), a.getScaStatus(), confirmationCodeCase))
                   .orElse(true);
    }

}