When a Muslim engages in an abundance of ibadah, abstains from sins, does not become attached to the world, and follows the Prophet sallallahu alayhi wa sallam in every way, he becomes the friend and beloved of Allah Ta’ala. Such a person is called a wali. At times, a wali does certain acts which cannot be done by others. These acts are called karamat (miracles, or noble and excellent deeds).
No matter how high a stage a wali may reach, he will never be equal to a prophet.
No matter how beloved to Allah a wali may become, as long as he is in his senses, it will be incumbent upon him to follow the Shariah. Salat, fasting, and any other act of worship is not forgiven. Acts which are sinful do not become permissible for him.
The person who acts contrary to the Shariah cannot be a friend of Allah. If he does some miraculous act, then it is either magic or something enacted through the influence of the soul or satan. These things should not be believed in.
At times, a wali comes to know of certain mysterious things either in his sleep or while awake. This is known as kashf or ilham (manifestations or inspirations). If these things are in conformity with the Shariah, they are acceptable, if not, they have to be rejected.
Allah and His Rasul sallallahu alayhi wa sallam have shown all the matters pertaining to the Deen in the Quran and Hadith. To bring some new thing into the Deen is not permitted. Suchnew things are known as bid’at (innovations). An innovation is a major sin.