Work in governmental offices is of two forms. One is the office of the just authorities whom God ordered to assign as rulers and ordered people to follow them. Within them are their officials and administrators down to the least official. The other form is the office of the unjust people and their officials down to the least unjust official.
The legality of this kind is the office of the just rulers whom God ordered to recognize and elect as leaders, and working in their main and secondary offices by following God’s instructions to the just rulers without adding, reducing, distorting, or neglecting anything of His revelation. If such just rulers who meet the previous qualities exist, then work in their offices will be legal and it will be completely legal to work, support, and hold them. In addition, the gain from such jobs will be legal. Working with such rulers and their officials will enliven every rightful and fair matter and kill every wrong, injustice, and corruption. Therefore, to support, help, and work with such rulers is as same as calling to the acts of obedience to God and strengthening His religion.
The illegality of work in governmental offices stands for the leadership of the unjust rulers and their officials beginning with the chief down to the novice. Working with them and gaining earnings from them are prohibited and illegal. The workers and gainers of such earnings will suffer punishment, apart from the amount of the work or the earnings. Every act that is seen as support for the unjust rulers is a grand sin, because the rule of the unjust rulers kills the right wholly and enlivens the wrong wholly. It also spreads injustice, oppression, and corruption, stays the laws of the Divine Books, kills the prophets and believers, destroys the mosques, and distorts God’s norms and principles. Accordingly, it is prohibited to work with them, support them, and seek earnings from their leadership saving in cases of necessity that is similar to the necessity of having blood or meat of corpses.