Since the introduction of secured properties which are readonly, a big part of the Java client calls fail when run as a non Administrator.
2 examples :
Builder builder = new NuxeoClient.Builder(); builder.url("http://localhost:8080/nuxeo") .authentication("joe", "joe") .schemas("*") .connectTimeout(0) .timeout(0); NuxeoClient nuxeoClient = builder.connect(); Document doc = nuxeoClient.repository().fetchDocumentById("78caf297-9dfb-4ffd-955f-24f81af864e8"); Operation operation = nuxeoClient.operation("Document.CreateVersion") .input(doc) .param("increment", "Minor"); operation.execute();
and
Builder builder = new NuxeoClient.Builder(); builder.url("http://localhost:8080/nuxeo").authentication("joe", "joe").schemas("*"); NuxeoClient client = builder.connect(); Document document = client.repository().fetchDocumentById("78caf297-9dfb-4ffd-955f-24f81af864e8"); ACP acp = document.fetchPermissions(); List<ACL> acls = acp.getAcls(); for (ACL acl :acls) { if (ACL.LOCAL_ACL.equals(acl.getName())) { for (ACE ace : acl.getAces()) { if ("thierry".equals(ace.getUsername())) { document.removePermission(ace.getId(), ace.getUsername(), ACL.LOCAL_ACL); } } } } client.disconnect();
Removing "schemas("*") from the client builder fixes both cases.