How to grant access to group to folder using REST API


I cannot find in the playground nor in the endpoints a way to add or remove a group from a folder/workspace ACL using the REST API

what's the endpoint to add a group to a single folder?

I can change the folder definition but that applies to every folder, instead I'd want a different group having access to it's own tree of documents all managed programatically.

when I try adding a local permission to the file using the management interface and get the file using the ID api, there is no local permission node into the document, so I can't edit it trough that particular endpoint, i.e.

GET nuxeo/site/api/v1/id/99762585-53b7-4276-9a1c-bffeaca7d448
1 votes

2 answers



This may solve your problem:

HttpAutomationClient autoclient = new HttpAutomationClient(“http://localhost:8080/nuxeo/site/automation”);

Session session = autoclient.getSession(“user”, “password”);

DocumentService documentService = new DocumentService(session);

Document root = (Document) session.newRequest(“Document.Fetch”).set(“value”, /docPath).execute();

documentService.setPermission(root, userName/groupName, “Read”);

0 votes

The ACL endpoint should give you informations … about the ACLs of a document

/id/{docId}/@acl : View the ACL of a document given its id

And the Document.SetACE operation can be used to change those ACLSs.

0 votes