As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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.
Document doc =documents.get(0);
Here is the REST API you can use to check Permission on a doc:
http://localhost:8080/nuxeo/site/api/v1/path/<Folder_Path>/@acl
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");