Freemarker document template : Failed to get document field: parent when UI clic ; even if login as admin
We got a strange behaviour in freemarker template.
A document template is write in Freemarker and do the operation document.parent on a nuxeo document even if user has no read right on it
- during a workflow process (A workflow is run by “system” user) => success it works.
- after a clic of a user on UI button => it fails for user tutu (error message below)
- after a clic of a user on UI button and even if Automation chain is arrounded by “login as” system… => it fails for user tutu, although I verify that “currentuser name” displays “system”… why ? (error message below)
=> Why in freemarker we can't do the operation doc.parent on document user hasn't “read right” on ?
=> Why login as system doesn't change anything ?
Failed to get document field: parent The problematic instruction: ==> local assignment: theDoc=currentDoc.parent freemarker.template.TemplateModelException: Failed to get document field: parent Caused by: org.nuxeo.ecm.core.api.DocumentSecurityException: Privilege READ is not granted to tutu