Permissions Folder

Showing results for 
Search instead for 
Did you mean: 
Active Member II

Permissions Folder


I have created a script for the creation of a folder, in order to insert a document:
var nomefinestra = space.childByNamePath(["ALTRO:nomefinestra"]);
if (nomefinestra== null)
nomefinestra = space.createFolder(["ALTRO:nomefinestra"]);
utente.setPermission("Coordinator","GROUP_Manager Ufficio Personale");

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,

3 Replies
Advanced II

Re: Permissions Folder

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?

Active Member II

Re: Permissions Folder

excuse was a mistake
nomefinestra.setPermission("Coordinator","GROUP_Manager Ufficio Personale");
the folder is located within the Repository
It is not in the site

Senior Member II

Re: Permissions Folder

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?