Appeal by defendant from a judgment of the Supreme Court, Kings County, rendered May 31, 1978, convicting him of criminal sale of a controlled substance in the third degree, criminal possession of a controlled substance in the seventh degree, and unlawful possession of *909marihuana, upon a jury verdict, and imposing sentence. Judgment affirmed. Defendant has argued that Criminal Term committed reversible error in sealing the courtroom to spectators, including the defendant’s mother, during the testimony of the undercover police officer to whom the defendant was accused of selling narcotics. He also has argued in support of reversal that the court erred in charging the jury on the question of unlawfulness: "So I charge you, as a matter of law, that if you find, beyond a reasonable doubt, that the defendant * * * sold a controlled substance, Heroin * * * you must find that he did so unlawfully.” From a review of the record on appeal, we find no support for the defendant’s contentions. Regarding Criminal Term’s sealing of the courtroom to spectators, the defendant argues that he was entitled, at the least, to a hearing before the People’s application to seal was granted, and he has cited this court’s recent decision in People v Roberto (67 AD2d 687). However, while no full hearing on the question of sealing was held, the trial court did direct an ad hoc inquiry to the undercover officer as to his current activities. In determining that the officer continued to operate in an undercover capacity in the same borough, the court properly ordered the sealing to protect the agent’s anonymity and, consequently, his utility to the police and his own personal safety. The court’s decision did not contravene the holding in Roberto (supra) where no inquiry was made before sealing. We find no error in the charge to the jury. The question of the lawfulness of possession or sale of a controlled substance is one of law, determinable pursuant to article 33 of the Public Health Law which identifies those classes of persons who lawfully may possess, sell, etc., a controlled substance. The defendant is not within one of those classes of persons and, therefore, the court properly instructed the jury that if they found, as a factual matter, the other relevant elements of the crime charged, as a matter of law they enjoyed no alternative but to find that the activity was unlawful. There can be no question but that issues of law are to be determined by the court and not the jury. Hopkins, J. P., Damiani, O’Connor and Mangano, JJ., concur.