The command (or the judgement) is for none but Allah. He has commanded that you worship none but Him, that is the only right path, but most men do not know.”TMQ: Surah Yusuf, 12:40
The final authority in all matters is with Allah (ﷻ) and His Messenger (ﷺ). In the Saheefat Al-Madeenah the Prophet (ﷺ) set down clearly in writing that, “No matter how much you disagree with one another regarding any matter, it comes back to Allah and to Muhammad (ﷺ) (for judgement).” The purpose behind this article is clear: It was to emphasise the fact that Al-Madeenah was to be ruled according to the Shari’ah and that the Messenger of Allah (ﷺ) was to be the leader of the newly formed state.
From the example of the Prophet (ﷺ) we learn that it is an obligation to establish Allah’s rule, for doing so is a worship in itself as mentioned in the Verse of the Qur’an above. Allah (ﷻ) said in this Verse, “The command is for none but Allah,” a reality that applies to worship, to beliefs, to dealings, and to all else.
Dear Muslims, you must therefore know that we do not have the right to judge in any matter based on our personal desires or opinions, and we will not have true Imaan until we make the Shari’ah the judge in all disputes and submit to it wholeheartedly.
But no, by your Lord, they will not [truly] believe until they make you, [O Muhammad], judge concerning that over which they dispute among themselves and then find within themselves no discomfort from what you have judged and submit in [full, willing] submission.”TMQ: Surah An-Nisaa’, 4:65