add template permission check
Added permission deined page