COMMENTARY on 12:76
A. Yusuf Ali:

Translation:
So he 1742 began (the search) with their baggage, before (he came to) the baggage 1743 of his brother: at length he brought it 1744 out of his brother´s baggage. Thus did We plan for Joseph. He could not take his brother by the law of the king except that Allah 1745 willed it (so). We raise to degrees (of wisdom) whom 1746 We please: but over all endued with knowledge is one, the All-Knowing.
Commentary:

1742  The pronoun "he" can only refer to Joseph. He may have been present all the time, or he may just have come up, as the supposed theft of the king's own cup (12:72 above) was a very serious and important affair, and the investigation required his personal supervision. All that his officers did by his orders was his own act. As the lawyers say: Qui facit per alium, facit per se (whoever does anything through another, does it himself).

1743  The Arabic word here used is wia', plural aw'iyah, which includes bags, lockers, boxes, or any receptacles in which things are stored. Notice the appropriateness of the words used. The cup was concealed in a saddlebag (rahl) , verse 70 above. When it comes to searching, they must search all the baggage of every description if the search was to be convincing and effective.

1744  It refers to the drinking cup, the siqayah, which is a feminine noun: hence the feminine pronoun, ha, in Arabic.

1745  Let no one suppose that it was a vulgar or wicked trick, such as we sometimes hear of in police courts, when property is planted on innocent men to get them into trouble. On the contrary, it was a device or stratagem whose purpose was to show up wickedness in its true colours, to give it a chance of repentance, to bring about forgiveness and reconciliation, to give solace to the aged father who had suffered so much, and above all, to further that larger plan for the instruction of the world, which is unfolded in Israel's religious history. Joseph was a Prophet of Allah, but he could not have carried out this plan or taken the first step, of detaining his brother, except with the will and permission of Allah, Whose Plan is universal and for all His creatures. (R).

1746  If we examine this world's affairs, there are all sorts of plans, and all degrees of folly and wisdom. The wicked ones plan; the foolish ones plan; the simple ones plan; then there are men who think themselves wise and are perhaps thought to be wise, but who are foolish, and they have their plans: and there are degrees of real and beneficent wisdom among men. Allah, the Universal Planner, is above all. Anything good in our wisdom is but a reflection of His wisdom, and His wisdom can even turn folly and wickedness to good.

 

Muhammad Asad:

Translation:
Thereupon [they were brought before Joseph to be searched; and] he began with the bags of his half-brothers 75 before the bag of his brother [Benjamin]: and in the end he brought forth the drinking Cups 76 out of his brother's bag. In this way did We contrive for Joseph [the attainment of his heart's desire]: under the King's law, he would [otherwise] not have been able to detain his brother, had not God so willed. We do raise to [high] degrees [of knowledge] whomever We will - but above everyone who is endowed with knowledge there is One who knows all. 77
Commentary:
75  Lit., "with their bags".
76  Lit., "he brought it out".
77  The meaning of this story is now clear: it is a further illustration of the basic doctrine that "judgment [as to what is to happen] rests with none but God" (verse 67 above). Joseph had wanted to keep Benjamin with himself, but under the law of Egypt he could not do this without the consent of his half-brothers, who were the legal guardians of their minor brother; and they -bound as they were by the solemn promise given to their father-would certainly not have agreed to Benjamin's remaining behind. The only other alternative open to Joseph was to disclose his identity to them; but since he was not yet prepared td go so far, he was obliged to allow Benjamin to depart with his brothers. The accidental discovery of his gift, entirely unexpected by Joseph (see note 72 above), changed everything: for now Benjamin appeared to be guilty of theft, and under the law of the land Joseph was entitled to claim him as his slave, and thus to keep him in his house. The words, "In this way did We contrive (kidna) for Joseph [the attainment of his heart's desire]", referring to the incident of the cup, indicate that its final outcome was neither planned nor even foreseen by Joseph.