Who Are the Awliya’ of Allah?
Question

I hope that you can help me to understand the following:
1. Who are the awliya’?
2. What are the degrees or ranks of the awliya’? 
3. Is it permissible to call the awliya’ “friends of Allah (ashab Allah)”?
Praise be to Allah.Who are the Awliya’ of Allah? 
The awliya’ of Allah (allies of Allah ) – clearly and briefly – are people of faith and piety, who are constantly aware that Allah, may He be exalted, is watching them in all their affairs, so they adhere to His commands and heed His prohibitions.
Allah, may He be exalted, says (interpretation of the meaning):
{Unquestionably, [for] the allies [awliya’] of Allah there will be no fear concerning them, nor will they grieve,
Those who believed and were fearing Allah, For them are good tidings in the worldly life and in the Hereafter. No change is there in the words of Allah. That is what is the great attainment} [Yunus 10:62-64].
Al-Hafiz Ibn Kathir (may Allah have mercy on him) said in Tafsir Al-Qur’an al-‘Azim (4/278):
“Here Allah, may He be exalted, tells us that His awliya’ are those who believe and fear Him, as their Lord describes them. So everyone who fears Allah and is mindful of Him is a wali (singular of awliya’). {There will be no fear concerning them} regarding what awaits in the future of the terrors of the resurrection, {nor will they grieve} for what they have left behind in this world.
‘Abdullah ibn Mas‘ud, Ibn ‘Abbas and more than one of the early generations said: The awliya’ of Allah are those who, if you see them, they remind you of Allah. This was narrated in a marfu‘ hadith.
It was narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Among the slaves of Allah are some whom the prophets and martyrs will envy.” It was said: Who are they, O Messenger of Allah, so that we may love them? He said: “They are people who love one another for the sake of Allah, not because of ties of trade or kindred. Their faces will be light on thrones of light. They will not fear when the people fear and they will not grieve when the people grieve.” Then he recited the words, {Unquestionably, [for] the allies [awliya’] of Allah there will be no fear concerning them, nor will they grieve} [Yunus 10:62]. Narrated by Abu Dawud with a jayyid isnad. It was classed as sahih by Al-Albani in As-Silsilah as-Sahihah (7/1369).”
Degree of wilayah 
The degree of wilayah [being a wali of Allah] varies according to a person’s faith and fear of Allah (taqwa). Every believer has a share of wilayah, love of Allah and closeness to Him, but this share varies according to his righteous deeds, both physical actions and deeds of the heart, by means of which he draws closer to Allah. Based on that, it is possible to divide the degrees and ranks of wilayah into three levels:

The one who wronged himself. This refers to the believer who commits sin. He will have a degree of wilayah commensurate with his level of faith and righteous deeds.
The one who is moderate. This refers to the believer who adheres to the commands of Allah and heeds His prohibitions, but he does not strive in doing supererogatory acts. He is of a higher level of wilayah than the first one.
The one who is foremost in good deeds. This is the one who does supererogatory acts as well as obligatory duties, and attains the highest level of worshipping Allah, may He be exalted, by doing deeds of the heart. This is one of the highest levels of wilayah.

There can be no doubt that prophethood is the highest and loftiest level of wilayah and being an ally of Allah, may He be glorified and exalted.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said in Majmu‘ al-Fatawa (10/6):
“People are of three levels: the one who wrongs himself, the one who is moderate, and the one who is foremost in good deeds.

The one who wrongs himself is the one who sins by failing to do what is enjoined or doing what is prohibited.
The one who is moderate is the one who does obligatory deeds and refrains from haram deeds.
The one who is foremost in good deeds is the one who draws close to Allah by doing whatever he can of obligatory and recommended (mustahabb) deeds, and refraining from haram and disliked (makruh) deeds.

Even though the one who is moderate or the one who is foremost in good deeds may commit some sins, they will be erased from their record, either by means of repentance – for Allah loves those who repent and He loves those who purify themselves – or by means of good deeds which erase bad deeds, or by means of calamities that expiate bad deeds, or by other means. Both categories, those who are moderate and those who are foremost in good deeds, are among the awliya’ of Allah whom He mentions in His Book when He says (interpretation of the meaning): {Unquestionably, [for] the allies [awliya’] of Allah there will be no fear concerning them, nor will they grieve} [Yunus 10:62]. Thus the definition of the ‘awliya’ of Allah is the believers who fear Him and are mindful of Him.
But these awliya’ may be divided into a general group, namely those who are moderate, and an elite group, namely those who are foremost in good deeds, even though those who are foremost in good deeds are the highest levels, such as the prophets and those who are strong and true in faith (siddiqs).
The Prophet (blessings and peace of Allah be upon him) mentioned these two categories in a hadith which was narrated by al-Bukhari in his Sahih from Abu Hurayrah (may Allah be pleased with him), from the Prophet (blessings and peace of Allah be upon him), who said: “Allah says: ‘Whosoever shows enmity to an ally of Mine has declared war on Me. My slave draws not close to Me with anything more loved by Me than the obligatory religious duties I have enjoined upon him, and My slave continues to draw close to Me with supererogatory deeds so that I will love him. So when I love him, I will be his hearing with which he hears, his vision with which he sees, his hand with which he strikes, and his foot with which he walks. So by My help and guidance he will hear, by My help and guidance he will see, by My help and guidance he will strike, and by My help and guidance he will walk. Were he to ask [something] of Me, I would surely give it to him, and were he to seek refuge in Me, I would surely grant him it. I do not hesitate to do anything as I hesitate to take the soul of My believing slave, for he hates death and I hate to hurt him, but there is no escaping it.’”
As for the believer who wrongs himself, he attains wilayah commensurate with the level of his faith and piety, just as he has the opposite of that commensurate with the level of his bad deeds, because an individual may do both good deeds that earn reward and bad deeds that incur punishment, so it is possible that he may be both rewarded and punished. This is the view of all the Companions of the Messenger of Allah (blessings and peace of Allah be upon him), the leading scholars of Islam, and Ahl as-Sunnah wa’l-Jama‘ah, who say that no one who has an atom’s weight of faith in his heart will abide forever in the Fire.”
Shaykh Ibn ‘Uthaymin said in Fatawa Muhimmah (p. 83):
“Whoever is a believer and fears Allah is a wali (ally) of Allah, and whoever is not like that is not a wali of Allah. If he has a little faith and fear of Allah, then he has some measure of wilayah.”
Is Wilayah exclusive to some particular class of people?
Wilayah is not a monopoly, and it is not exclusive to some particular class of people. It cannot be inherited and it cannot be awarded like a medal. Rather it is a divinely granted status that begins in the heart with love and veneration of Allah, may He be glorified and exalted, and is reflected in a person’s behaviour, so that that individual attains the love and wilayah of Allah, may He be exalted.
Can the Wali of Allah do haram deeds?
Wilayah does not mean that a person can do haram deeds or omit obligatory duties; rather if a person does that, it indicates that his wilayah is lacking. By the same token, it does not allow anyone else to exaggerate about those whom they call awliya’ – who may not even deserve that – and elevate them to the level of prophethood, to the extent that they would not refuse any instruction that they give them, and would not debate any view or opinion that they suggest. All of that comes under the heading of exaggeration which Allah, may He be exalted, has forbidden, for it is one of the greatest causes of people falling into shirk (association of others with Allah).
Some people have overstepped this mark and fallen into major shirk because of a failure to properly understand the meaning of wilayah and the status of the awliya’. Hence you see them calling upon the awliya’ instead of Allah, making sacrifices and other offerings to them, and circumambulating their tombs.
Is it permissible to call the awliya’ the “friends of Allah (ashab Allah)”?
With regard to calling the awliya’ the “friends of Allah (ashab Allah),” there is nothing to suggest that this is a sound way of describing them.
The best of the ‘awliya’ of Allah, may He be exalted, are the messengers and prophets, then the Companions of Prophet Muhammad (blessings and peace of Allah be upon him), then those who came after them, then those who came after them. We do not know that the phrase “ashab Allah (friends of Allah)” was given to any of them.
Rather it was soundly narrated from the Messenger (blessings and peace of Allah be upon him) that they are called Ahl al-Quran (the people of the Quran) or Ahl Allah (the people of Allah).
Imam Ahmad (11870) and Ibn Majah (215) narrated that the Prophet (blessings and peace of Allah be upon him) said: “Allah has His own people among mankind.” They said, O Messenger of Allah, who are they? He said, “The people of the Quran, the people of Allah and those who are closest to Him.” (Classed as sahih by al-Albani in Sahih Ibn Majah)
The people of the Quran are those who have memorised it, recite it and act in accordance with its teachings.
The people of Allah are His awliya’ (allies) who are as close to Him as a man is to his own family.
And Allah knows best.