add code for privilege level checking.