Government job while running for MP

I am a young woman working as a junior officer in one of the ministries. I have worked in public service for three years now, and want to serve my constituency as a Member of Parliament. Yesterday, a photo of me taking the MP contesting form from the party offices was shared on social media. My boss saw it and immediately sent an email stating that I must resign first. I told my boss I thought I could take leave and return to my job if I lost. I also informed him that the leave forms had been signed and received by the human resources officer the previous week. Do I really have to resign to stand in elections? I was beginning my career in the government and thought becoming an MP was an extension of my desire to serve in the government. Please guide me.
EM, Dodoma

This is election year in Tanzania, and it is encouraging to see Tanzanian youth showing interest in serving their country. Yes, under Tanzanian law, public servants are required to resign before participating in electoral politics. The Standing Orders for The Public Service 2009, Third Edition, states that while some public servants, such as those in the Ministry, are permitted to participate in politics, they shall do so with restrictions. Order F21(a) specifies that a public servant must not be employed by or hold office in any political party while still in public service. This rule ensures impartiality and prevents misuse of public office for political reasons. The National Electoral Commission (NEC) also requires a formal resignation letter to accompany a nomination. Taking unpaid leave or an administrative sabbatical does not meet these legal requirements. Engaging in politics while still employed as a civil servant may lead to disqualification from the election and potentially result in disciplinary action. Therefore, you must formally resign before the nomination deadline if you wish to stand as a candidate. Consult your lawyer on your options.