The courthouse in Azrou in Morocco's Atlas Mountains is where locals come to present their issues to a judge. These include family issues — like divorce, inheritance and child custody cases. The courthouse is as grand and plain as any government building in the world. Outside, men and women patiently wait their turn to see a judge.

But one woman is not so patient. She stands by the courthouse, upset. "I don’t have any rights, and I need the law to be on my side so that he can’t hit me anymore," she says. She’s at the courthouse today seeking a divorce. A decade ago, her husband would have had to give his permission. But today, under the Moudawana family code, she can ask the judge for a divorce herself.

According to Nadia Sonneveld, a legal anthropologist studying Morocco's implementation of Moudawana in rural populations, the new family code is quite revolutionary compared to the old one.

"Morocco has one of the most progressive family law codes, except for Tunisia,” she says. In Egypt, for example, the wife has a legal obligation to be obedient to her husband.

“And that means she must ask for his permission to leave the house. For work or to buy groceries, she should, legally speaking, ask for his permission," Sonneveld says.

Women in many Muslim-majority countries, including Morocco, run the home and drive many of the family decisions. So it's only natural they should have some say in their and their family's legal status. That’s the goal of many Islamic feminists — to find a way to improve women’s rights within existing Islamic law.

Judge Mohammed Zerda is president of the family court division in Tangier. There are ten judges in his court — three male, and seven female. When asked if that makes a difference, he says, "This is simple, there’s absolutely no difference between female judges and male judges. We all went through the same schooling and same education and every judge must be neutral."

There are a few sources a judge in Morocco can reference when making a decision: First is the Moudawana. Then there’s the Maliki school of jurisprudence, which relies on the Quran and the hadiths, or the reported sayings of the Prophet Muhammad. The Quran is seen as the direct word from God — it's divine and cannot be changed or questioned. The hadiths, on the other hand, were collected by men, so they're open to debate. Judge Zerda looks at both sources when deciding a case. But he sometimes has to go to the last source — that gray area between what’s written and local customs.

He remembers one divorce ruling in which he awarded the woman a portion of the family property.

"I gave her a quarter of the property,” he says. “Mind you in the Islamic Sharia the law gives her one-eighth."

In another example, legal anthropologist Nadia Sonneveld tells the story of a 12-year-old girl who asked a judge for permission to marry. The female judge refused, based on her age. A year later, the girl came back pregnant and again asked for permission. Because in Moroccan culture it's very important that a child carry the family name of the father, the judge had to reconsider.

"This judge told me, 'What should I do? If I refuse her request she will give birth to a bastard and the child will have no future in Moroccan society. And if I allow it, I’m actually encouraging this phenomenon.'"

In the end, the judge decided to legalize the marriage.

Critics of the 2004 family code say it doesn't do enough to protect the rights of women and girls when it comes to minimum age of marriage, polygamy, and distribution of property. But more important, says Judge Zerda, is educating the population — especially in rural areas — about the rights they do have under Moudawana.

"For us in the city of Tangier, we know that not all the people that come to the courts do know about their rights and the laws," he says.

Ten years since its implementation, the family law code in Morocco is firmly established in the courts. But it's still working its way down to the people.