Q.The person is asking with regards to the hadeeth, ‘there is no obedience to creation and disobedience to Allaah’. If a person goes to hajj without a permit, does it fall under this category?
A.The shaykh said no, rather what it falls under is the statement of Allaah (azza wa jall) in the Qur’aan; ‘Obey Allaah, obey the messenger and those in authority from amongst you’. So if the rulers and those in authority, if they give an order which has a benefit for the ummah, it has a general benefit for the ummah then it is obligatory that we obey them. But it is not permissible for us to obey them if they order us to perform a sin or if they prevent us from performing something which is obligatory. So if they order us to perform a sin we do not obey them and if they prevent us from performing something obligatory we likewise do not obey them.
Shaykh Saalih Muhammad al-Luhaydaan (May Allaah preserve him) (Kitaab-ut-Tawheed Class, Q&A Session 06-10-2012, Riyadh)