manage permissions in restart function