Implement permission control

Implement permission control