<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Freemarker document template : Failed to get document field: parent when UI clic ; even if login as admin in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/freemarker-document-template-failed-to-get-document-field-parent/m-p/327307#M14308</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;We got a strange behaviour in freemarker template.&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;during a workflow process (A workflow is run by "system" user) =&amp;gt; success it works.&lt;/LI&gt;
&lt;LI&gt;after a clic of a user on UI button =&amp;gt; it fails for user tutu (error message below)&lt;/LI&gt;
&lt;LI&gt;after a clic of a user on UI button and even if Automation chain is arrounded by "login as" system...  =&amp;gt; it fails for user tutu, although I verify that "currentuser name" displays "system"... why ? (error message below)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;=&amp;gt; Why in freemarker we can't do the operation doc.parent on document user hasn't "read right" on ?&lt;/P&gt;
&lt;P&gt;=&amp;gt; Why login as system doesn't change anything ?&lt;/P&gt;
&lt;P&gt;Error message:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Failed to get document field: parent
The problematic instruction:
==&amp;gt; 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
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Ref: [http://answers.nuxeo.com/questions/6863/document-template-get-all-a-document-path-with-title-and-not-name][1]&lt;/P&gt;
&lt;P&gt;Thank you
[1]: &lt;A href="http://answers.nuxeo.com/questions/6863/document-template-get-all-a-document-path-with-title-and-not-name" target="test_blank"&gt;http://answers.nuxeo.com/questions/6863/document-template-get-all-a-document-path-with-title-and-not-name&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2013 10:24:40 GMT</pubDate>
    <dc:creator>milonette_</dc:creator>
    <dc:date>2013-10-21T10:24:40Z</dc:date>
    <item>
      <title>Freemarker document template : Failed to get document field: parent when UI clic ; even if login as admin</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/freemarker-document-template-failed-to-get-document-field-parent/m-p/327307#M14308</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;We got a strange behaviour in freemarker template.&lt;/P&gt;
&lt;P&gt;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&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;during a workflow process (A workflow is run by "system" user) =&amp;gt; success it works.&lt;/LI&gt;
&lt;LI&gt;after a clic of a user on UI button =&amp;gt; it fails for user tutu (error message below)&lt;/LI&gt;
&lt;LI&gt;after a clic of a user on UI button and even if Automation chain is arrounded by "login as" system...  =&amp;gt; it fails for user tutu, although I verify that "currentuser name" displays "system"... why ? (error message below)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;=&amp;gt; Why in freemarker we can't do the operation doc.parent on document user hasn't "read right" on ?&lt;/P&gt;
&lt;P&gt;=&amp;gt; Why login as system doesn't change anything ?&lt;/P&gt;
&lt;P&gt;Error message:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Failed to get document field: parent
The problematic instruction:
==&amp;gt; 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
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Ref: [http://answers.nuxeo.com/questions/6863/document-template-get-all-a-document-path-with-title-and-not-name][1]&lt;/P&gt;
&lt;P&gt;Thank you
[1]: &lt;A href="http://answers.nuxeo.com/questions/6863/document-template-get-all-a-document-path-with-title-and-not-name" target="test_blank"&gt;http://answers.nuxeo.com/questions/6863/document-template-get-all-a-document-path-with-title-and-not-name&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2013 10:24:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/freemarker-document-template-failed-to-get-document-field-parent/m-p/327307#M14308</guid>
      <dc:creator>milonette_</dc:creator>
      <dc:date>2013-10-21T10:24:40Z</dc:date>
    </item>
  </channel>
</rss>

