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 thu... 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.
Solved! Go to Solution.
IMO there is no way to be sure that this is going to run in every invocation.
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
So you can make a REST invocation and then use your CMIS code.
IMO there is no way to be sure that this is going to run in every invocation.
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
So you can make a REST invocation and then use your CMIS code.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.