(b) required for the purpose of preventing, detecting or investigating offences, apprehendingor prosecuting offenders or assessing or collecting any tax, duty or other moneys owed or payable to the State, a local authority or a health board, in any case in which the applicationof those restrictions would be likely to prejudice any of the matters aforesaid,