| 112 | | /** Demonstrates that the repository is wiped out between too |
|---|
| | 117 | // This test Requires Nuxeo Core > 1.4.0 (changeUser appears in rev 30024) |
|---|
| | 118 | // To use it, change the dependency of nuxeo-jcr-connector-test to |
|---|
| | 119 | // 1.4.1-SNAPSHOT |
|---|
| | 120 | // public void testSecurity() throws Exception { |
|---|
| | 121 | // DocumentRef ref = createBook(); |
|---|
| | 122 | // DocumentModel docModel = coreSession.getDocument(ref); |
|---|
| | 123 | // ACP acp = docModel.getACP(); |
|---|
| | 124 | // // use of the 'local' ACL |
|---|
| | 125 | // ACL acl = acp.getOrCreateACL("local"); |
|---|
| | 126 | // acl.add(new ACE("toto", SecurityConstants.READ, true)); |
|---|
| | 127 | // acp.addACL(acl); |
|---|
| | 128 | // acl = new ACLImpl("specific"); |
|---|
| | 129 | // acl.add(new ACE("toto", SecurityConstants.WRITE, true)); |
|---|
| | 130 | // acp.addACL(0, acl); |
|---|
| | 131 | // docModel.setACP(acp, false); |
|---|
| | 132 | // coreSession.saveDocument(docModel); |
|---|
| | 133 | |
|---|
| | 134 | // changeUser("toto"); |
|---|
| | 135 | // docModel = coreSession.getDocument(ref); |
|---|
| | 136 | // assertTrue(coreSession.hasPermission(ref, SecurityConstants.WRITE)); |
|---|
| | 137 | //} |
|---|
| | 138 | |
|---|
| | 139 | /** Demonstrates that the repository is wiped out between two |
|---|