Imam Sadiq (peace be upon him): Muawiya ibn Ammar said: Imam Sadiq (peace be upon him) said: "The Imamate is a covenant and pledge from Allah the Mighty and Majestic, established for named men. The Imam has no right to divert it from the one who is to come after him. Indeed, Allah the Blessed and Exalted revealed to Dawud (peace be upon him) to choose a successor (wasi) from his family, for it has been decreed in My knowledge that I do not send any prophet without there being for him a successor from his family." Dawud (peace be upon him) had many children, and among them was a young lad whose mother was with Dawud (peace be upon him) and whom Dawud (peace be upon him) loved. When this revelation reached Dawud (peace be upon him), he went to that woman and said to her: "Allah the Mighty and Majestic has revealed to me and commanded me to choose a successor from my own family." His wife said to him: "It would be good if it were my son." Dawud (peace be upon him) said: "That is what I too desire." But it had been decreed in Allah's prior and definite knowledge that his successor would be Sulayman (peace be upon him). Allah the Blessed and Exalted revealed to Dawud (peace be upon him): Do not hasten in this matter until My command reaches you. It was not long before two men came to Dawud (peace be upon him) and disputed about sheep and a vineyard [for the sheep of one had eaten the vineyard of the other]. Allah the Mighty and Majestic revealed to Dawud (peace be upon him): Gather your sons; whoever renders the correct judgement in this case is your successor after you. Dawud (peace be upon him) gathered his sons, and when the two disputants told their story, Sulayman (peace be upon him) said: "O owner of the vineyard! When did this man's sheep enter your vineyard?" He said: "At night." Sulayman (peace be upon him) said: "O owner of the sheep! I rule that the lambs and wool of your sheep this year belong to the owner of the vineyard." Dawud (peace be upon him) said to him: "Why did you not rule that he give the sheep themselves, given that the scholars of the Children of Israel have appraised it and the value of the vineyard is equal to the value of the sheep?" Sulayman (peace be upon him) said: "The vines have not been uprooted from their roots; only their fruit has been eaten, and next year they will bear fruit again." Allah the Mighty and Majestic revealed to Dawud (peace be upon him): "The judgement in this case is what Sulayman (peace be upon him) has issued. O Dawud (peace be upon him), you wanted one thing and We wanted another (you wanted that son of yours for succession, and We wanted Sulayman (peace be upon him))." Dawud (peace be upon him) went to his wife and said: "We wanted one thing and Allah the Mighty and Majestic wanted another, and nothing comes to pass except what Allah wills. We are content with the command of Allah the Mighty and Majestic and submit to it." And such is the matter of the successors and Imams (peace be upon them): they too have no right to transgress the command of Allah and give the Imamate from its rightful owner to another.