LPS-39254 Avoid doPrivileged call in processTemplate, when security is not required