def METHOD_NAME(request: ResearcherRequest, block_test_studies: bool) -> Tuple[Study, Researcher]:
    """ Checks whether the researcher is allowed to do api access on this study.
    Parameter allows control of whether to allow the api call to hit a test study. """
    study = api_get_study_confirm_exists(request)
    researcher = api_get_validate_researcher_on_study(request, study)
    do_block = block_test_studies and not study.is_test
    if not researcher.site_admin and do_block:
        # You're only allowed to download chunked data from test studies, otherwise doesn't exist.
        log("study not accessible to researcher")
        return abort(404)
    return study, researcher