The Qur'an not only talks about the possibility of others having access to the ilmu 'l-ghayb, it actually gives vrious examples of those who had been given the ilmu l-ghayb by Almighty Allah.
1. While counting the miraclous powers that he possessed, Prophet 'Isa (as) says:
"I will inform you of what you are eating and what you storing in your houses ... ."(3: 48)
2. In reference to Prophet Yusuf, we have the following verses:
"And thus does your lord choose you and teaches you the interpretation of words."(12: 6,21)
... And when they agreed to put him into the bottom of the pit, We revealed to him that (a time shall coem when) you will inform them of this affair of theirs..." (12: 15)
"... I shall inform you two of its interpretation before comes to you (the food) : this is from what my Lord has taught me..." (12: 37)
3. Prophet Sulayman were taught the language of the birds :
"And Sulayman ... he said, O men! We have been taught the language of the birds." (27: 16)
4. According to the Qur'an, Allah had bestowed ilmu 'l-ghayb upon the Prophet of Islam as can be seen in the following verses:
Refering to the events of the past, Allah ways:
"These are the news of the ghayb that We revealed unto you ..." (11:49)
Referring to the events of the past, Allah says, "These are the news of the unseen (ghayb) that We reveal unto you ..." (12 : 102)
Allah informed the Prophet about the on-going war between the Easterm Roman Empire and the Sasanid Persian Empire : "the Romans are vanquished in a nearby land; and they, after being vanquished, shall overcome (the Persians) within a few years ..." (30: 1-4)
On the conquest of Mecca at the hand of the Muslims, Allah said, "Certainly Allah had shown to His Apostle the vision with truth; you shall most certainly enter the Sacred Mosque (in Mecca), if Allah pleases, in security ... ." (48 : 27)
The Prophet is also informed about the inner most thoughts of the hypocrites; " ... And they say in their own hearts, Why does not Allah punish us for what we say? ... .(58 : 8)
As you can see, these examples cover all aspests of ghayb: history of the ast, events of the future, language of the birds, and also the intentions of other people. The Prophet is described as someone "who was not niggardly of the ghayb," (81: 24) he used to share the information with others.
Before we end this section, let me remind the readers tha the knowledge of ghayb if a human being or an angel isnot his own but is always and constantly depondent upon the will of Allah. That is why the Messengers were instructed to say that they do not possess 'ilmu 'l-ghayb. (6: 50; 11:
3) It is for the same reason that prophet Muhammad (s.a.w.) was instructed to say:
"Had I knowledge of the ghayb, I would have acquited much good, and evil would not have touched me." (7 : 188)
This is not a denial of having ilmu 'l-ghayb; it is affirmation ot the belief that whatever knowledge he has is according to the wish and pleasure of Almighty Allah.1
____________
1. For a precise and clear picture on the knowledge of God (which is absolute and unchanging, and is described as "al-lawh al-mahfuz-- the protected tablet") vis-a-vis the knowledge of chosen human beings and angels (which is not neceearuly absolute, and is descrbed as "lauhu 'l-mahw wa 'l-ithbat- the tablet that can be erased and rewritten"), see S. Saeed Akhtar Rizvi, The Justice of God, p.21-26.the book clearly explains that bada, (change) does not occur in the knowledge of God, it can only occur in the knowledge of humans and angels.