def METHOD_NAME(
    request: Request,
    course_key: CourseKey,
    access_point: str = 'enrollment',
    user: Optional[types.User] = None,
) -> Optional[str]:
    """
    Redirect if the user does not have access to the course.
    Even if the user would normally be blocked, if the given access_point is 'courseware' and the course has enabled
    the `is_disabled_access_check` flag, then the user can still view that course.
    Arguments:
        request: The current request to be checked.
        course_key: Location of the course the user is trying to access.
        access_point: Type of page being accessed (e.g. 'courseware', 'enrollment', etc)
        user: User to check for (uses request.user if None)
    Returns:
        If blocked, a URL path to a page explaining why the user was blocked. Else None.
    """
    if settings.FEATURES.get('EMBARGO'):
        if legacy_ip.USE_LEGACY_IP.is_enabled():
            client_ips = [legacy_ip.get_legacy_ip(request)]
        else:
            client_ips = ip.get_all_client_ips(request)
        user = user or request.user
        is_blocked = not check_course_access(course_key, user=user, ip_addresses=client_ips, url=request.path)
        if is_blocked:
            if access_point == "courseware":
                if not RestrictedCourse.is_disabled_access_check(course_key):
                    return message_url_path(course_key, access_point)
            else:
                return message_url_path(course_key, access_point)