CIC
Canon 289
Book II. The People of God
Faithful and Church organization
Code of Canon Law
English§1. Since military service is hardly in keeping with the clerical state, clerics and candidates for sacred orders are not to volunteer for military service except with the permission of their ordinary.
§2. Clerics are to use exemptions from exercising functions and public civil offices foreign to the clerical state which laws and agreements or customs grant in their favor unless their proper ordinary has decided otherwise in particular cases.