A hazardous duty officer shall not be prohibited by an employer from engaging in any political activity when the officer is off duty, except as otherwise provided by law.