¶1OPINION
¶2delivered the opinion of the Court,
¶3After appellant pled nolo contendere to the offense of the sale of an alcoholic beverage to a minor,
¶4I. Facts
¶5On October 30, 1998, 17-year-old Shannon Berger entered the Mustang Lounge at the direction of her Aunt, Berenice Berger, a Texas Alcoholic Beverage Commission (“TABC”) agent. Shannon Berger was to attempt to purchase an alcoholic beverage inside the bar as part of an undercover operation by the TABC. She was accompanied by another TABC agent, Daryl Darnell, who witnessed the events that occurred inside the bar. Appellant sold a beer to Shannon Berger, a minor, without asking for identification in violation of § 106.03 of the Texas Alcoholic Beverage Code.
¶6Appellant filed a motion to suppress “any evidence acquired as a result of the actions” of the TABC officers. Appellant based this motion on the fact that there was a sign posted in the Mustang Lounge
¶7II. Appellate Decision and Grounds for Review
¶8The court of appeals held that Shannon Berger was a trespasser under Texas Penal Code § 30.05, and that she was not an “authorized representative” of the TABC under § 101.04 of the Texas Alcoholic Beverage Code, which would permit her entry onto the premises without a warrant.
By accepting a license or permit, the holder consents that the commission, an authorized representative of the commission, or a peace officer may enter the licensed premises at any time to conduct an investigation or inspect the premises for the purpose of performing any duty imposed by this code, (emphasis added)
¶9The court of appeals further held that Shannon Berger was not an authorized representative because, despite the State’s contention that § 106.05 of the Texas Alcoholic Beverage Code allowed Shannon Berger to participate in the undercover operation, the provision “does not expressly authorize TABC agents to recruit minors to enter licensed premises for the purpose of purchasing alcohol.”
¶10This Court granted review on two questions: first, does a 17-year-old commit criminal trespass by entering and remaining in a bar under the direction of the TABC despite the existence of a sign inside the bar seeking to exclude minors? Second, does a violation of the criminal trespass statute invoke article 38.23 of the Texas Code of Criminal Procedure?
¶11The State argues that Shannon Berger was an “authorized representative” of the TABC and therefore was statutorily authorized to enter the premises. Further, the State argues that even if the court found she was not an “authorized representative,” the trial court could have found her conduct justified under Texas Penal Code § 9.21, and found that her conduct did not constitute criminal trespass.
¶12Appellant argues that Shannon Berger’s conduct was unarguably criminal trespass under Texas Penal Code § 30.05, due to the fact that the Mustang Lounge had posted a “no trespassing” sign giving notice that minors were not to enter the premises. Thus, Appellant asserts that this violation of the penal code by Shannon Berger acting in conjunction with the TABC agents triggers the application of Texas Code of Criminal Procedure Article 38.23.
¶13III. Analysis
¶14The primary question in this case, as posed in the first ground for review, is whether a minor recruited by the TABC to enforce the provisions of the Texas Alcoholic Beverage Code through conducting a sting operation inside a bar, commits criminal trespass if the target establishment has posted a “no trespassing to those under 21” sign. To answer this question, it is helpful to analyze as a whole the way the code addresses issues related to minors.
¶15Section 101.04 of the Texas Alcoholic Beverage Code provides TABC officers *514with the authority to enter a licensed establishment at any time for an inspection without first notifying the owner or obtaining any sort of warrant as long as they are performing duties given to them by the Texas Alcoholic Beverage Code.
¶16In particular, two sections relating to minors are informative in trying to discern whether minors acting under TABC authority are criminal trespassers in this situation. Section 106.05, entitled “Possession of Alcohol by a Minor,” states that a minor commits an offense if he or she possesses an alcoholic beverage, subject only to several exceptions listed. The exception relevant to our inquiry is the following: the minor may possess an alcoholic beverage “if the minor is under the immediate supervision of a commissioned peace officer engaged in enforcing the provisions of this code.”
¶17This exception was created in a 1997 amendment by the 75th Legislature in H.B. 3441. According to the bill analysis prepared by the House Committee on Licensing and Administrative Procedures, the purpose of this amendment was to “vest the commission with statutory authority to utilize minors in the conduct of sting operations identifying retailers who sell alcoholic beverages to minors.”
¶18The Texas Alcoholic Beverage Code expressly provides that minors are not to be held criminally liable for possession or purchase of alcohol if they are assisting TABC officers in carrying out the provisions of the code. It would be absurd for the Legislature to pass such legislation allowing minors to purchase and possess alcohol to assist the TABC if they did not also intend for these minors to be able to have access to the targets of the sting operations without being criminally liable for trespass. If minors are liable for criminal trespass for assisting the TABC, it could possibly lead to claims by anyone who posted a “no trespassing” sign on their establishment that the evidence should be suppressed pursuant to Article 38.23. This would allow any bar owner to thwart any undercover operation by the TABC merely by posting a “no trespassing *515by persons under 21” sign outside the establishment. Such an interpretation would render many of the provisions of the Alcoholic Beverage Code regarding the sale of alcohol to minors practically unenforceable.
¶19The statute does not expressly state that minors are not to be held liable for criminal trespass if they are assisting the TABC. However, we assume that because minors in this situation act at the specific request of TABC officers, and on behalf of the TABC itself, to enforce the provisions of the TABC Code through sting operations, they should not be considered trespassers even in the face of a no trespassing sign.
¶20By accepting a license or permit to sell alcohol, the Mustang Lounge consented to inspection by TABC agents. Shannon Berger was a minor recruited by and under the immediate supervision of Agent Berenice Berger to help conduct a sting operations that was expressly contemplated by the legislature. Therefore, as to the first ground for review, we hold that Shannon Burger was not a criminal trespasser under Texas Penal Code § 30.05.
¶21Because no laws were violated by police officers, TABC agents, or Shannon Berger, Texas Code of Criminal Procedure Article 38.23 was not implicated, and the trial judge did not err in denying Appellant’s motion to suppress. Thus, it is unnecessary to address the second ground for review. The decision of the court of appeals is reversed, and we uphold the ruling of the trial court.
¶22. Tex. Alco. Bev.Code § 106.03(a) (Vernon 2004).
¶23. Texas Rule of Appellate Procedure 25.2(b)(3) states that if an appeal is from a judgment rendered on the defendant’s plea of guilty or nolo contendere, a defendant may appeal only "those matters that were raised by written motion and filed and ruled on before trial, or after getting the trial court’s permission to appeal.”
¶24. Phillips v. State, 109 S.W.3d 562 (Tex.App.Corpus Christi 2003, pet. granted).
¶25. Tex Alco. Bev.Code § 106.03(a) (Vernon 2004).
¶26. The record is unclear as to whether this sign was posted outside or inside the lounge in a visible area.
¶27. Texas Code of Criminal Procedure Article 38.23 states in relevant part: "No evidence obtained by an officer or other person in violation of any provisions of the Constitution or laws of the State of Texas, or of the Constitution or laws of the United States of Amer-ica, shall be admitted in evidence against the accused on the trial of any criminal case.”
¶28. Phillips, 109 S.W.3d at 566.
¶29. Id. at 567.
¶30. Id. at 572-73.
¶31. Texas Penal Code § 9.21 provides a public duty justification defense to crimes committed. It provides in relevant part that “the justification afforded by this section is available if the actor reasonably believes ... his conduct is required or authorized to assist a public servant in the performance of his official duty, even though the servant exceeds his lawful authority.”
¶34. House Comm. On Licensing and Administrative Procedures, Bill Analysis, Tex. H.B. 3441, 75th Leg., R.S. (1997).
¶35. Id.
¶36. See Tex. Alco. Bev.Code §§ 106.02, 106.05 (Vernon 2004).