The diversities of operations ... refers to various spiritual influences at work, for instance such as are manifested in Spiritism, anarchism, and the numerous other "isms." To know whether an influence with a professedly moral, or reformatory, aim is from the Holy Spirit, or from another source, is a special gift. (Doctrine and Covenants Commentary, p.274)
There are two spiritual gifts in particular—the gifts of administration and of discernment—that the Lord has placed in his church to keep his people from being led astray. The saints need not fall heir to false doctrine; they have no need to accept false ordinances; they need not be led astray by false gifts; and their worship can be kept pure and perfect—as long as these two gifts are in active operation.
Paul says that "there are diversities of gifts, but the same Spirit. And there are differences of administrations, but the same Lord. And there are diversities of operations, but it is the same God which worketh all in all." Then he names some of the spiritual gifts that are administered or dispensed to the individual saints. He compares these gifts to the members or parts of the body, each gift being a separate member but all of them together forming one body. The church, he says, is "the body of Christ," and each of the saints is a part or member of that body. Apostles, prophets, teachers, miracles, healings, governments—all of these, he says, are found in the true church. And through the officers named, the church is governed and the gospel is administered. (1 Corinthians 12.)
Paul then gives a comparison between charity and the gifts of the Spirit (1 Corinthians 13), followed by a long discussion on the relative importance of prophecy and tongues. Following this, certain conclusions are reached, such as: All things are to be done unto edifying. Only two or three should speak in tongues in one meeting. An interpreter must always be present. Two or three prophets may speak while the other prophets sit in judgment upon their words. All prophetic utterances are subject to and governed by other prophets. Presiding prophets are always in control. There is to be no confusion, no disorder. All things are to be done decently and in order. (1 Corinthians 14.) That is to say, there is order and system in the church. Someone is always in charge. Members do not act independently as their whims dictate. The Lord's house is a house of order. Someone with discernment sits in judgment on what is said and done, rejecting the bad and approving the good....
Also: "It is given by the Holy Ghost to some to know the diversities of operations, whether they be of God, that the manifestations of the Spirit may be given to every man to profit withal." It is to the gift of discernment that reference is here made. Appointed leaders must be able to divide true doctrine from false, to single out true prophets from the false, to discern between true spirits and false ones.
"And unto the bishop of the church, and unto such as God shall appoint and ordain to watch over the church and to be elders unto the church, are to have it given unto them to discern all those gifts lest there shall be any among you professing and yet be not of God. And it shall come to pass that he that asketh in Spirit shall receive in Spirit; that unto some it may be given to have all those gifts, that there may be a head, in order that every member may be profited thereby." (D&C 46:7-29.)
As long as the Lord's people enjoy the gifts of the Spirit, including the gifts of administration and discernment, they will never go astray. (A New Witness for the Articles of Faith, p.277-278)