They were in uniform. That's a no-no.
They can voice their opinions, even actively campaign for or against a candidate, do any kind of politicking and engage in any kind of political activities they want, as long as they aren't in uniform, or on duty, or in a government office, or using a...