Canada has passed a law allowing doctors to prescribe heroin for severe addicts.