(request, domain, case_id)
return case
Get case if accessible else raise a 404 or 403
Get case if accessible else raise a 404 or 403
Get case if accessible else raise a 404 or 403
def safely_get_case(request, domain, case_id):
    """Get case if accessible else raise a 404 or 403"""
    case = get_case_or_404(domain, case_id)
    if not (request.can_access_all_locations or
            user_can_access_case(domain, request.couch_user, case)):
        raise location_restricted_exception(request)
    return case
def safely_get_case ( request , domain , case_id ) : case = get_case_or_404 ( domain , case_id ) if not ( request . can_access_all_locations or user_can_access_case ( domain , request . couch_user , case ) ) : raise location_restricted_exception ( request ) return case