Handling permissions using templates

to be written