cancel
Showing results for 
Search instead for 
Did you mean: 

How to grant access to group to folder using REST API

Lorenzo_
Champ in-the-making
Champ in-the-making

Hi

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
{"entity-type":"document","repository":"default","uid":"99762585-53b7-4276-9a1c-bffeaca7d448",
 "path":"/default-domain/workspaces/data","type":"Workspace","state":"project","parentRef":
 "7edb2187-348a-49c2-9ecf-1b767c856cc9","versionLabel":"","isCheckedOut":true,"title":"data",
 "lastModified":"2015-02-24T15:00:28.00Z","facets":
["SuperSpace","Folderish"],"changeToken":"1424790028000","contextParameters":{}}
2 REPLIES 2

pibou_Bouvret
Elite Collaborator
Elite Collaborator

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.

Anurag_Kumar
Confirmed Champ
Confirmed Champ

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”);

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.