Feature/template permissions

Closes #126 
Closes #127