* @throws Exception
*/
public void testCheckPermissions() throws Exception {
// user
NodeImpl rootNode = (NodeImpl) session.getRootNode().getNode(ROOT_PATH);
ExtendedNode node = (ExtendedNode) rootNode.addNode("testAuditHistory", "nt:unstructured");
node.addMixin("exo:auditable");
if (!service.hasHistory(node))
service.createHistory(node);
session.save();
service.addRecord(null, node, Event.NODE_ADDED);
session.save();
// user
NodeImpl rootNode1 = (NodeImpl) exo1Session.getRootNode().getNode(ROOT_PATH);
// Should not be autocreated
ExtendedNode node1 = (ExtendedNode) rootNode1.addNode("testAuditHistory", "nt:unstructured");
node1.addMixin("exo:auditable");
if (!service.hasHistory(node1))
service.createHistory(node1);
exo1Session.save();
service.addRecord(null, node1, Event.NODE_ADDED);
exo1Session.save();
try {
NodeImpl rootNode2 = (NodeImpl) exo2Session.getRootNode().getNode(ROOT_PATH);
ExtendedNode node2= (ExtendedNode) rootNode2.getNode("testAuditHistory");
service.removeHistory(node2);
exo2Session.save();
fail();
} catch (AccessDeniedException e) {