Anselm Of Canterbury said this quote

And what we say - that what He willeth is right and what He doth not not will is wrong, is not so to be understood, as if, should God will something inconsistent, it would be right because He willed it. For it does not follow that if God would lie it would be right to lie, but rather that he were not God.