The Supreme Court, in a major decision for organized labor, ruled yesterday that office workers with access to their employers' confidential information can join labor unions.

The decision, written by Justice William J. Brennan Jr., said that only those employes who deal directly with labor-management issues can be excluded from protection under the nation's labor laws.

This "labor-nexus" test has been the policy of the National Labor Relations Board, but it was contested by two employers who said workers with access to confidential business information were excluded from protection under the National Labor Relations Act.

Justices Byron R. White, Thurgood Marshall, Harry A. Blackmun and John Paul Stevens joined in the decision. Chief Justice Warren E. Burger and justices Lewis F. Powell, William H. Rehnquist and Sandra D. O'Connor concurred in part and dissented in part.

The decision, which resolves a 40-year-old labor-management dispute, "is pretty important because if the Labor Board lost it, a lot of white collar employes and possibly some blue collar employes who had access to some confidential information might have lost protection under the National Labor Relations Act," an NLRB official said. At least "several hundreds of thousands of employes" are affected by the ruling, the official said.

District 9 to 5, a national campaign to organize office workers, yesterday hailed the justices' decision and said that, according to Labor Department figures, one million secretaries could have been excluded from labor union protections if the court had ruled in favor of the employers.

Powell said in his separate opinion that he agreed with the majority that persons privy to confidential business information are not excluded from protection by labor laws merely because they have that access.

But he said, "By its rigid insistence on the labor nexus in the case of confidential secretaries, the National Labor Relations Board and now this court have lost sight of the basic purpose of the labor nexus test itself and of the fundamental theory of our labor laws.

"Thus, it makes little sense to exclude 'expediters,' 'assistant buyers' and 'employment interviewers' as managerial but include within the rank and file confidential secretaries who are privy to the most sensitive details of management decision-making, who work closely with managers on a personal and daily basis and who occupy a position of trust incompatible with labor-management strife," Powell said. "To include employes so clearly allied to management within the ranks of labor does a disservice to management and labor alike."

The high court's decision reversed an appeals court ruling in the case of Mary Weatherman, a nine-year employe of a rural electric membership cooperative who was fired after signing a petition to reinstate a close friend who had lost his arm while employed with the cooperative.

Weatherman filed an unfair labor practice charge with the NLRB, but her former employer claimed she was not protected by the National Labor Relations Act because she was a confidential secretary. The cooperative didn't dispute that Weatherman's duties were unrelated to labor policies.

However, the court added in a footnote, "We do not suggest that personal secretaries to the chief executive officers of corporations will ordinarily not constitute confidential employes." Weatherman was specifically restricted from handling labor decisions and "it is unlikely that Weatherman's position mirrored that of executive secretaries in general," the court said.