<?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 Changing folder permit inheritance from java application in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/changing-folder-permit-inheritance-from-java-application/m-p/55530#M20275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are using CMIS to interact from java web application with Alfresco repository. Folder permissions are also&amp;nbsp;changed by CMIS except folder permit inheritance.&lt;/P&gt;&lt;P&gt;To turn off&amp;nbsp;&lt;SPAN&gt;permit inheritance on each&amp;nbsp;folder we had to use folder rule with script (in brief):&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;function main()&lt;BR /&gt;{&lt;BR /&gt; if (document.isContainer) &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.setInheritsPermissions(false);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;main();&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The folders were&amp;nbsp;under some root folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The application uses POST REST which creates&amp;nbsp;folder and immediatly after this creates files inside folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It was supposed, that at the moment, when files are added, rules have&amp;nbsp;already&amp;nbsp;fired.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It all worked fine for a long, but at some moment&amp;nbsp;we began to get errors while changing folder ACL via CMIS:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;unexpected shared acl&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;According to this link:&amp;nbsp;&lt;A class="link-titled" href="https://issues.alfresco.com/jira/browse/MNT-12003" title="https://issues.alfresco.com/jira/browse/MNT-12003" rel="nofollow noopener noreferrer"&gt;[MNT-12003] Thumbnail ACL inconsistent after move (possible concurrency problem between move and thumbnail generation) -…&lt;/A&gt;&amp;nbsp; &amp;nbsp;the&amp;nbsp;error was&amp;nbsp;the result of creating file inside folder before&amp;nbsp;folder rule fired, so first file acl was inherited from root folder, not from the parent folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the queston is, how&amp;nbsp;to provide&amp;nbsp;consistent interaction of&amp;nbsp;folder rule and CMIS in upper described case, may be there is a way to lock folder until the rule is fired.&lt;/P&gt;&lt;P&gt;Currently&amp;nbsp;I have to check folder permit inheritence before adding files, and if the rule has not fired, to bypass adding files till next REST call.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jan 2018 09:23:11 GMT</pubDate>
    <dc:creator>skushnerenko</dc:creator>
    <dc:date>2018-01-26T09:23:11Z</dc:date>
    <item>
      <title>Changing folder permit inheritance from java application</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/changing-folder-permit-inheritance-from-java-application/m-p/55530#M20275</link>
      <description>We are using CMIS to interact from java web application with Alfresco repository. Folder permissions are also&amp;nbsp;changed by CMIS except folder permit inheritance.To turn off&amp;nbsp;permit inheritance on each&amp;nbsp;folder we had to use folder rule with script (in brief):function main(){ if (document.isContainer) &amp;nbsp;&amp;nbsp;&amp;nbsp;</description>
      <pubDate>Fri, 26 Jan 2018 09:23:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/changing-folder-permit-inheritance-from-java-application/m-p/55530#M20275</guid>
      <dc:creator>skushnerenko</dc:creator>
      <dc:date>2018-01-26T09:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing folder permit inheritance from java application</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/changing-folder-permit-inheritance-from-java-application/m-p/55531#M20276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IMO there is no way to be sure that this is going to run in every invocation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to change the rule by other approach. As CMIS does not allow to reset inheritance, you should use Alfresco Native REST API. I'm not aware that this option is available in the new Rest API (the Swagger one) nor in the traditional Rest API. So you have to use Share REST API (which is not the best choice but it's the only one). Take a look at&amp;nbsp;&lt;A __default_attr="188308" __jive_macro_name="thread" _jive_internal="true" class="jive_macro_thread jive_macro link-titled" href="https://community.alfresco.com/thread/188308-change-inherit-parent-space-permissions-using-resfull-api" rel="nofollow noopener noreferrer"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can make a REST invocation and then use your CMIS code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jan 2018 17:20:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/changing-folder-permit-inheritance-from-java-application/m-p/55531#M20276</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2018-01-26T17:20:50Z</dc:date>
    </item>
  </channel>
</rss>

