We have no knowledge but that which You have taught us...
We have no knowledge but that which You have taught us; surely You are the Knowing, the Wise.” (2:32) “He said: 'O Adam! inform them of their names. Then when he had informed them of their names, He said 'Did I not say to you that I surely know what is hidden (ghayb) in the heavens and the earth and (that) I know what you manifest and what you hide?” (2:33) So at least one of condition of being khalifah of Allah is conclusive knowledge.
According to Shi'ism all the fourteen infallibles had this knowledge. We say: “Peace be with you, O representatives of Allah on earth.” When a person is chosen to be khalifah, he at least has one of two types of guardianship: Guardianship over the universe and creatures. Having this kind of guardianship one can do everything in this world such as reviving the dead, curing the sick. It is called 'generative guardianship. Guardianship in judgement and making Jaws.
Ordinary people can never make laws. Even a mujtahid can not make any law and his job is just to refer to Islamic sources and understand practical laws. Also Islamic parliament can not make some laws instead of Divine laws. They try their best to apply general laws to different situations and if they make some laws, they are really filling empty places in the legislative universe which is delegated to them by Allah (to the people or to the legal authority).
This kind of guardianship is called 'legislative guardianship' . According to the verse (38:26) Dawud (a.s.) had this kind of guardianship. Adam (a.s.) was khalifah on earth while perhaps there was no need for laws or judgements (for a further discussion of the very point look at comments on the verse 2:21). So at least his actual guardianship was generative.
But after deeper study it will be obvious that every representative of Allah was allowed to apply his guardianship in both aspects: generative and legislative, if necessary and possible. Previous…