This sentence is not an exact quotation, but a summary of the doctrine set forth by J. S. Mill in his treatise On Liberty (Introduction).

ME Book 4 Chapter 5 Section 1