With Israeli-Palestinian peace talks under way again in Washington, questions persist about whether Israel will agree to a Palestinian state on the basis of the pre-1967 borders, the so-called Green Line. In the meantime, Palestinians in the West Bank and Gaza are keeping a wary eye on the red lines that constrain what they can say and do.

Israel's repression of freedom of expression for Palestinians living in the West Bank is well known. Israeli military laws restrict the size of Palestinian demonstrations to fewer than 10 people on any issue that "could be interpreted as political" without a military permit. Israeli forces have raided Palestinian TV stations, closed a USAID-funded Palestinian university media programme, and shot and wounded journalists at West Bank demonstrations. During the November fighting in Gaza, Israeli airstrikes targeted journalists and media offices.

Yet Palestinian leaders have also restricted the ability of Palestinians to debate crucial public issues despite their repeated claims that they respect the rights to freedom of expression and peaceful assembly. In the West Bank, Palestinian Authority police in Ramallah on July 28 used batons to beat demonstrators who were protesting the Washington talks. Police then went to the hospital and arrested three injured protesters who had gone to the emergency room.

The police, despite years of European training, have used this kind of excessive force before. Just over a year ago, on June 30 and July 1, 2012, Palestinian police kicked, punched, and bludgeoned protesters who had gathered in Ramallah to demonstrate against a planned visit by an Israeli politician, Shaul Mofaz, to meet with the Palestinian president, Mahmud Abbas. The police dragged several protesters into a nearby police station and continued to beat them. Six protesters, and at least one Palestinian journalist covering the event, were hospitalised.

In Gaza, the ruling Hamas government, more focused on events in Cairo than in Washington, still represses free discussion of crucial public issues. On July 25, Gaza authorities closed the offices of Ma'an News Agency, a Palestinian outlet, and Al Arabiya TV, the regional broadcaster, on the basis that they had "fabricat[ed] news and diffused false rumours and baseless information, threatening civil peace," the Gaza prosecutor general said.

Officials said they closed the media outlets in response to news articles and broadcasts on the relationship between Hamas and Egypt's Muslim Brotherhood, now in a confrontation with Egypt's military-backed government following the army's removal of President Mohammed Morsi from the presidency. The issue is sensitive because since the overthrow of Morsi, Egyptian media and officials have played up alleged illegal connections between Hamas and the Brotherhood. The Egyptian military has destroyed many of the smuggling tunnels that had been a lifeline for the Israeli-blockaded Gaza Strip, stretching under the border between Egypt and Gaza.

The Ma'an and Al Arabiya reports clearly touched a nerve. Gaza officials' closures of the media outlets were arbitrary and excessive, in violation of international law. And the police detectives who shut them down refused to provide copies of the closure orders as local law requires. On July 29, Hamas authorities summoned Ma'an's Gaza bureau chief for questioning and confiscated his office keys, the Palestinian journalists' union said.

Both Hamas and the Palestinian Authority have histories of repressing critical news reporting and demonstrations. A Palestinian group, the Centre for Development and Media Freedoms, documented 74 violations of journalists' rights by Hamas and the Palestinian Authority in 2012 – including arbitrary arrests, interrogations, travel bans, and website closures, among others – down from 106 violations in 2011, but hardly a positive record. Each of the two factions, which are bitter rivals, has banned the publication or circulation of newspapers supporting the other.

News media have at times aired unsubstantiated allegations against Palestinian officials. In 2009, for instance, Al Jazeera aired a Palestinian politician's claims that Abbas was complicit in an alleged Israeli plot to assassinate Yasser Arafat, who died in 2004. The Palestinian Authority responded by closing Al Jazeera's West Bank bureau. But scandal is no excuse for such unnecessary restrictions on media. Under international human rights law, governments may only restrict freedom of expression for legitimate reasons, such as national security or public order, and any restrictions must be proportionate.

For too long, the Palestinian Authority and Hamas have been suppressing dissenting views. In the context of contentious peace talks, both authorities are likely to hear more and more news and views they do not like. Their allies should tell them, and Israel, that it's time to take Palestinians' rights to free expression and assembly seriously.

Bill Van Esveld is a Middle East researcher at Human Rights Watch