Hasan Ibn Husain Anbari narrates:
Over a period of fourteen years I kept writing letters to Imam Ridha (peace be upon him), seeking permission from him to allow me to work within the administrative setup of the ruler (of the city).
Since the Imam (peace be upon him) never replied, I, in my final letter, wrote: I fear oppression and persecution. Those working with the Sultan say: “You are of the Shiites and this is why you do not co-operate with us and are evasive.”
In reply, the Imam (peace be upon him) said: From your letter I sense that you fear for your life. You are aware that if you are placed in a (high and) responsible position, you can adhere to and act upon the teachings and Sunnah of the Holy Prophet (peace be upon him and his holy progeny); this would cause your subordinates to also follow the dictates of your faith.
If you happen to come across instances whereby you have to deal with poor and indigent Mu’minin, ensure that you exhibit consideration, toleration and forbearance towards them!
And since you would now be working with them, it would be deemed that you are one of them, (and thus) you would have to strive hard to perform God-pleasing deeds, since these deeds would then serve to compensate your co-operation with the illegal ruling apparatus.
However, if you are unable to act in this manner, then it is not permissible for you to take up this employment. ( Baa Mardum In Guneh Barkhord Kuneem, p. 65. )