As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
/*Set permission to a folder using Alfresco javascript API*/ //search for the folder node using lucene search var folderNode = search.luceneSearch('+PATH:"/app:company_home/cm:testing/*" AND TYPE:\"cm:folder" AND @cm\\:name:"test"'); //make sure we only get one node if(folderNode.length == 1){ //set permission "Contributor" to user with username "anythingalfresco" and group "ANYTHINGALFRESCOGROUP" folderNode[0].setPermission("Contributor", user); folderNode[0].setInheritsPermissions(false); model.myStatus = "Permission was set successfully!"; }else if (folderNode.length == 0){ //no node was found model.myStatus = "Folder not found"; }else{ //either greater than two was found model.myStatus = "Duplicate folder found"; }