Any city officer or employee who is sued for any act done in his official capacity, may justify such action under this charter, and the provisions of this charter may be pleaded and shall be a full defense for such an act.