The state barely avoided contempt of court last week, following what looked like an attempt to circumvent the High Court's ruling striking down the amendment that let the state hold illegal African migrants in custody for three years. But the cabinet's proposed legislation to replace the annulled law shows contempt for the court and holds the Israeli government up to ridicule.

One can agree with the government's position that it is necessary to reduce the number of migrants entering Israel, though one could also argue that a country with a history like ours should be more sympathetic to them. In any case, one cannot accept taking illegal and inhumane measures to reduce the number of migrants entering the country.

Not only does the government's bill not seem to recognize the court ruling regarding future migrants, it would let the government confine migrants currently in Israel in a facility run by the prison service. The migrants would have to sleep there and report three times a day, and could be held for an unlimited period of time. This is nothing but a different sort of detention.

The building of the fence along the Egyptian border by the Netanyahu government has led to a sharp drop in the number of migrants trying to get into Israel. But the prime minister believes that it’s not just the fence that achieved this, but the detention allowed under the law that was struck down by the High Court. Whether or not the law had an effect, Israel cannot use measures that are illegal and contradict its international obligations under the Convention and Protocol Relating to the Status of Refugees, which it has signed.

Israel isn’t checking whether each individual migrant is eligible for refugee status. While it has granted general protection to migrants from Eritrea and Sudan, it is not letting them work or start a business, and prevents them from sending money back to their families. All this forces them to violate the law. It’s no shock that such circumstances lead to the phenomena that the residents of south Tel Aviv have been complaining about.

Israel must change its approach. The fence is preventing the entrance of new migrants, but those already in Israel must be treated in accordance with Jewish and democratic values. They must be allowed to work and enjoy basic rights so they can live here under humane circumstances until they can return to their countries of origin.