“The Muslim is obliged to obey (the ruler) whether he likes it or not, unless he is commanded to commit an act of disobedience. If he is commanded to commit a sin then he should neither listen nor obey.”
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ عَلَى الْمَرْءِ الْمُسْلِمِ الطَّاعَةُ فِيمَا أَحَبَّ أَوْ كَرِهَ إِلاَّ أَنْ يُؤْمَرَ بِمَعْصِيَةٍ فَمَنْ أُمِرَ بِمَعْصِيَةٍ فَلاَ سَمْعَ وَلاَ طَاعَةَ