Added permission control functionality