As for a woman's work in the judiciary, Abu Hanifah permits her to be a judge in cases in which her testimony is accepted; that is, in cases other than criminal ones. Ibn Hazm and at-Tabari, however, are of the opinion that a woman can be a judge in all cases.
Here, we should keep in mind that the permissibility of appointing a woman as a judge does not necessitate it. Rather, the public interest of the Muslim society and the welfare of the woman herself and the family should be the main criteria in deciding whether it is necessary to appoint a woman in such a serious position or not. Accordingly, some distinguished women of a certain age [that is, with enough experience] may be appointed judges regarding certain matters and under certain circumstances.
As for the prohibition of appointing a woman as the ruler or the caliph of a Muslim state, it is because often she cannot bear the burdens of that tremendous job. We say "often" to refer to the fact that there may be some women who are more powerful and forbearing than some men, such as the Queen of Saba [Sheba] whose story is related by Allah in the Quran . Yet this is unusual and the Islamic rulings, therefore, cannot be founded upon exceptions.
However, there is nothing wrong if a woman is appointed as head of an institution or a member of parliament as long as it is within the interests of the Muslim society.