03-22-2017 06:31 AM
Hi,
I have created a script for the creation of a folder, in order to insert a document:
var nomefinestra = space.childByNamePath(document.properties["ALTRO:nomefinestra"]);
if (nomefinestra== null)
{
nomefinestra = space.createFolder(document.properties["ALTRO:nomefinestra"]);
utente.setPermission("Coordinator","GROUP_Manager Ufficio Personale");
}
document.move(nomefinestra)
the user with who I try to archive the document, belong to the "GROUP_Manager Ufficio Personale",
it is set with the coordinator role in the father folder.
When I try to insert the file it gives me the following message:
"You do not have appropriate permissions to perform this operation "
in order to make it function I have to set to the GROUP_Manager Ufficio Personale the role of :ADMINISTRATOR,
And I don't want to do that,
thank you in advanced for your help and patience,
03-23-2017 10:17 AM
Is that folder inside a Share site?
If that is the case, you could try to set permissions using the site's roles groups, like collaborator or contributor.
EDIT: I have just noticed that you have a variable that I could not find what it is referring, that is utente
Are you sure you are setting the permission in the right object?
03-23-2017 10:36 AM
excuse was a mistake
nomefinestra.setPermission("Coordinator","GROUP_Manager Ufficio Personale");
the folder is located within the Repository
It is not in the site
03-24-2017 03:04 AM
Is your script triggered by a rule? - seems so, because you use the objects document and space, which are root-scope objects and are injected in the script as global values.
Try shorten your script, only create the folder and set the permission.
Check the resulting folder, are the permissions applied as you expect?
Is "space" really the place where you want the folder to be created (I often use document.parent when referring the directory the document is placed in)?
Try a few debug messages to catalina.out with logger.system.out Are all variables valued as expected?
Are you using the javascript console?
Explore our Alfresco products with the links below. Use labels to filter content by product module.