AnsweredAssumed Answered

Changing folder permit inheritance from java application

Question asked by skushnerenko on Jan 26, 2018
Latest reply on Jan 26, 2018 by angelborroy

We are using CMIS to interact from java web application with Alfresco repository. Folder permissions are also changed by CMIS except folder permit inheritance.

To turn off permit inheritance on each folder we had to use folder rule with script (in brief):

function main()
{
if (document.isContainer)
   document.setInheritsPermissions(false);
}

main();

The folders were under some root folder.

The application uses POST REST which creates folder and immediatly after this creates files inside folder.

It was supposed, that at the moment, when files are added, rules have already fired.

It all worked fine for a long, but at some moment we began to get errors while changing folder ACL via CMIS:

unexpected shared acl

According to this link: [MNT-12003] Thumbnail ACL inconsistent after move (possible concurrency problem between move and thumbnail generation) -…   the error was the result of creating file inside folder before folder rule fired, so first file acl was inherited from root folder, not from the parent folder.

 

So, the queston is, how to provide consistent interaction of folder rule and CMIS in upper described case, may be there is a way to lock folder until the rule is fired.

Currently 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.

Outcomes