Misconduct occurring while an officer is working, exercising official authority, or performing an assigned law-enforcement function.