THANKS TO MAYOR BARRY and an experienced and sensitive police department, the city of Washington has reacted extremely well so far to local pressures of the Iranian situation. Though a federal judge yesterday blocked a federal attempt to ban demonstrations, Mr. Barry and the Carter administration had handled the situation with due caution. Mr. Barry, a frequent demonstrator himself as a civil rights activist, faced a personally difficult decision on whether to permit demonstrations here -- and he responded with respect both for freedom of assembly and for the lives of the American hostages in Tehran.

On Nov. 8, at a meeting requested by Mayor Barry, top Carter administration officials first warned him that violence resulting from a planned march and rally here could further endanger those lives. The White House officials were careful not to request specifically that the city cancel march permits; when asked if the president wanted the demonstration banned, an aide replied, "The White House does not tell the mayor what to do." That welcome switch left the options up to the mayor, who, said he recognized the sensitivity of the situation.

Meanwhile, D.C. Deputy Police Chief Robert Klotz was meeting into the night with student leaders in an effort to reach agreements on the size and route of the planned march. The next day, the march took place without serious incident. Only after this exerise did Mayor Barry -- "with mixed emotions" -- announce that he would issue no more city permits for Iran demonstrations. Mr. Barry noted that he continues to support constitutional rights to speak and assemble freely, but he said he feared that the hostages' lives "would be in great danger if the traditional marches and rallies took place."

This is an uncomfortable position, but the immediate and real threat to life and limb was a legitimate, justified reason for denying additional demonstration permits on city property. It also has been applied even-handedly, for the ban has been directed at no particular political side. In this sense, it has been like a curfew, in which certain freedoms are temporarily curtailed for the general public safety. There are times for demonstrations -- but right now is not one.