ExtendedNode testRoot = (ExtendedNode)root.addNode("testRoot");
testRoot.addMixin("exo:privilegeable");
testRoot.setPermission("john", new String[]{PermissionType.READ, PermissionType.ADD_NODE,
PermissionType.SET_PROPERTY});
testRoot.setPermission(root.getSession().getUserID(), PermissionType.ALL);
testRoot.removePermission(SystemIdentity.ANY);
ExtendedNode subRoot = (ExtendedNode)testRoot.addNode("subroot");
root.getSession().save();
testRoot.addMixin("exo:owneable");