added functions to add/remove privileges