In his treatise on the passions in the Summa Theologiae, Thomas Aquinas, discussing the goodness of pleasure, asks whether pleasure is the measure or rule for judging moral goodness or badness. He argues that it is, on the basis of the three principles that (1) moral goodness depends upon the will, that (2) the goodness of the will depends chiefly upon the end to which it is directed, and that (3) pleasure or delight is most of all an end, since it is not desirable for the sake of anything further.
Moral goodness or badness depends chiefly on the will, as was said above (q. 20, a. 1); and it is chiefly from the end that we discern whether the will is good or evil. Now the end is taken to be that in which the will rests, and the rest of the will and of every appetite in the good is pleasure. And therefore man is judged to be good or bad chiefly according to the pleasure of the human will, since that man who takes pleasure in the works of virtue is good and virtuous, and that man who takes pleasure in evil works is evil (Summa Theologiae, I-II, q. 34, a. 4).
The difficulty we encounter, however, is that pleasure itself always has a further measure–we take delight in an action that which we find or perceive to be good. Thomas consistently affirms that actions themselves are the ends of pleasures, in the sense that pleasures are explained by actions (e.g., we find pleasure in eating, and in seeking truth, because these things are naturally good for us). Now the most fundamental relationship we have to the good is not that of taking pleasure in it, but that of love for it. So it seems the criterion of the just man, or of the humble man, should be that he love justice or humility, not that he take delight in them. This is also fits with of virtue as the "order of love." If we look at virtue as St. Augustine does, as the "order of love" within us (ordo amoris), it seems we should rather say that love is the measure of moral goodness, rather than pleasure or delight.
From the perspective of historical influence and authorities, one thing to remark here is that Aquinas is here following Aristotle's Ethics in describing pleasure as the measure of moral goodness. The only other place I'm aware of where Aquinas unfolds this view of pleasure as the measure of goodness in detail, is in his Commentary on the Nichomachean Ethics.
Is Thomas Aquinas simply being inconsistent here, putting together the Augustinian (and his own) view where love has priority in regard to moral, human, and Christian goodness, with Aristotle's view? No, Thomas himself is aware of the difficulty, and addresses it in the first objection and reply to it in this article. The objection argues that love and desire come prior to pleasure, and therefore have more the character of a governing principle or measure. In response, Thomas says:
Love and desire precede pleasure in the order of generation. But pleasure precedes them with respect to the account of an end, which in actions has the account of a principle, by which judgment is most of all made, as by a rule or measure.
The "end" here is that which one comes to last, and which thus manifests everything that comes before it. The reason why an act of justice is morally good is indeed the love for justice from which it springs, but the manifestation of the goodness of justice is the delight the just man takes in acting justly. And since a measure or rule has to be readily known, it is pleasure which is described as the measure of goodness, rather than love.