Rigid Symmetries and {BRST} Invariance in Gauge Theories