Whenever the officers of justice are authorized to act in the prevention of public offenses, other persons who, by command of the officers of justice, act in aid of the officers of justice, are justified in so doing.