Landmark ruling on liability in prisons