authorize method added to template of controller methods