NEW YORK MAYOR Rudolph Giuliani's attack on the Brooklyn Museum of Art has been rebuffed by a federal district judge. Her order offers some helpful guidelines in the realm of public subsidies for art that offends a segment of the public. The Brooklyn Museum, with the ethics of the "Sensation!" show's funding under serious scrutiny, must by now doubt the wisdom of its decision to wage this calculated attack on public sensibilities. But the limits on what government can do about already-funded art are actually fairly clear.

Years of fights over artwork deemed offensive have made plain that the right to say what you please and the right to obtain government funding to say it are two different things. The government is not obliged to fund all speech; however, it also may not actively suppress and punish speech it finds offensive, even by withholding money it had previously allocated.

Is government then powerless to avoid the use of public funds for art that would outrage some part of the funding public? As Mr. Giuliani's case helps clarify, the way the government goes about limiting what it funds is all-important. When Mr. Giuliani first declared, on hearing of Chris Ofili's image of the Virgin Mary decorated with a clump of elephant dung, that the museum could show anything it liked but was not entitled to public money to do it, he was literally correct. The Supreme Court concluded last year that the National Endowment for the Arts could take into account "general standards of decency and respect for the diverse beliefs and values of the American public" when choosing whether to fund artists. This was so even if the effect was to bar funds to artists who offended the NEA's critics.

But Mr. Giuliani went further: He sought to cut funding, end the museum's 100-year-old city lease and fire its board, all to force the removal after the fact of a specific art work. The issue, wrote U.S. District Judge Nina Gershon, "is not whether the City could have been required to provide funding for the Sensation Exhibit, but whether the Museum, having been allocated a general operating subsidy, can now be penalized . . . because of the perceived viewpoint of the works in the Exhibit. The answer to that question is no."