'Check the country access rules for a given course.
Applies only to courseware URLs.
Args:
user (User): The user making the current request.
ip_address (str): The IP address from which the request originated.
url_path (str): The request path.
Returns:
HttpResponse or None'

def country_access_rules(self, user, ip_address, url_path):

    course_id = course_id_from_url(url_path)
    if course_id:
        redirect_url = embargo_api.redirect_if_blocked(course_id, user=user, ip_address=ip_address, url=url_path, access_point='courseware')
        if redirect_url:
            return redirect(redirect_url)
