The ban is based in part on the Hatch Act, which bans federal employees from engaging in partisan political activity.