sessionWS1.save();
subNode.addNode("subNode2");
sessionWS1.save();
Repository repository = repositoryService.getRepository("db2");
Credentials credentialsAdmin = new CredentialsImpl("admin", "admin".toCharArray());
Session s = (SessionImpl)repository.login(credentialsAdmin, "ws1");
ExtendedNode en = (ExtendedNode)s.getItem("/testPermissionInheritance3");
assertEquals(rootEn.getACL().getOwner(), en.getACL().getOwner());
assertEquals(rootEn.getACL().getPermissionsSize(), en.getACL().getPermissionsSize());
assertEquals(4, en.getACL().getPermissions(SystemIdentity.ANY).size());
assertEquals(0, en.getACL().getPermissions("mary").size());
ExtendedNode enSub = (ExtendedNode)en.getNode("subNode");
assertEquals(rootEn.getACL().getOwner(), enSub.getACL().getOwner());
assertEquals(rootEn.getACL().getPermissionsSize(), enSub.getACL().getPermissionsSize());
assertEquals(4, enSub.getACL().getPermissions(SystemIdentity.ANY).size());
assertEquals(0, enSub.getACL().getPermissions("mary").size());
ExtendedNode enSub2 = (ExtendedNode)enSub.getNode("subNode2");
assertEquals(rootEn.getACL().getOwner(), enSub2.getACL().getOwner());
assertEquals(rootEn.getACL().getPermissionsSize(), enSub2.getACL().getPermissionsSize());
assertEquals(4, enSub2.getACL().getPermissions(SystemIdentity.ANY).size());
assertEquals(0, enSub2.getACL().getPermissions("mary").size());
en.addMixin("exo:owneable");
s.save();
s.logout();
Credentials credentialsMary = new CredentialsImpl("mary", "exo".toCharArray());
s = (SessionImpl)repository.login(credentialsMary, "ws1");
en = (ExtendedNode)s.getItem("/testPermissionInheritance3/subNode");
en.addMixin("exo:privilegeable");
en.setPermission("*:/platform/administrators", new String[]{PermissionType.READ, PermissionType.SET_PROPERTY});
en.setPermission("mary", new String[]{PermissionType.READ, PermissionType.SET_PROPERTY});