Every officer while acting as such is, because of his or her appointment, taken to be a police officer and to have the powers and privileges of a police officer for performing his or her duties as an officer.