Sheikh `Abdul-Majeed Subh, a prominent Azharite scholar, states: “The first duty that a fair ruler should consider is to consider himself chosen from people for the service of the people. Serving the people can be achieved by the following:
1- preserving the identity of the Muslim through respecting his belief which is the core of the Muslim character whether he is an individual or group.
2- The purity of the economic system from haram because bread and `Aqeedah (creed) are the basis for granting man the ability to be fruitful and righteous.
3- taking care of the intellectual freedom of man. The ruler should not fight thought.
In this way, man will enjoy his freedom which is his normal right.
As for the unfair ruler, he is the one who contradicts anything from the above. The Ummah (nation) has to advise him first. If he acted upon their advise, then it is ok. If he did not accept the advise, he has to resign or the people has to push him to resign through legal means.
I know some scholars who are of the opinion that we have to obey the ruler even if he has been misled. But I say that this is incomplete knowledge because Muslim’s duty with regard to an unfair ruler to say to him that he is an unfair and to push him to be fair.