(2)Subject to the provisions of Section 197 of [the Code of Criminal Procedure, 1973 (2 of 1974)], no Court shall take cognizance of an offence committed or alleged to have been committed by any Prohibition, Police or other officer or any person empowered to exercise powers or to perform functions under this Act, in regard to anything done under this Act, until the sanction of the Collector having jurisdiction has been obtained.