The D.C. Court of Appeals yesterday curbed the power of Superior Court grand juries to order persons not arrested or charged in cases to appear in a police lineup.

The court's 9-0 ruling said government prosecutors investigating cases must provide a judge with facts showing a legitimate reason for the grand jury's order that a person appear in a lineup, if that order is challenged.

In the past, judges could enforce grand jury lineup orders without prosecurors having to formally demonstrate what connection the individual had with the case.

Judge George R. Gallagher said prosecurors must make some "minimal factual showing sufficient" for the judge to conclude there is a reason for the lineup "consistent with the legitimate function of the grand jury."

Gallagher said the court was concerned with "avoiding the appearance of, or the potential for abuse of the grand jury system" and with insuring "that the prosecutor and the grand jury are acting in good faith and not arbitrarily or to harass. . ."

Silas J. Wasserstrom, an attorney with the District's Public Defender Service, called the case "significant because it puts some kinds of controls on the prosecutor's power through the grand jury to force people who are not charged with crimes to come to the police station and undergo the demeaning experience of standing in a lineup."

The case stemmed from a 1979 arson investigation in which a man not arrested or charged in the case refused to comply with a grand jury order that he stand in a police lineup.

Wasserstrom said the decision could result in an increase in the number of people who contest such orders. U.S. Attorney Charles F. C. Ruff declined comment on the case.