How do i check permission of a document?

i want to check permission on a document(like folder) through pragmatically.how do i get all permission on a document like read,write.is there any API.

Thanks in advance.

1 votes

1 answers

1583 views

ANSWER

Document doc =documents.get(0); on this document i want to check permission(read,write). without using CoreSession through AutomationClient
10/08/2012



Here is the REST API you can use to check Permission on a doc:

http://localhost:8080/nuxeo/site/api/v1/path/

ex : http://localhost:8080/nuxeo/site/api/v1/path/default-domain/workspaces/@acl this gives me a json which contains permission info on Folder workspaces.

for setting permission you need to use Nuxeo Automation Client. below is the code snippet for the same: 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/docName).execute(); documentService.setPermission(root, userName/groupName, “Read”);

0 votes