nodeToLockSession1.setPermissions(perm);
session1.save();
nodeToLockSession1.lock(true, false);// boolean isSessionScoped=false
assertTrue(nodeToLockSession1.isLocked());
nodeToLockSession1.unlock();
assertFalse(nodeToLockSession1.isLocked());
Session session2 = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
session2.checkPermission(nodeToLockSession1.getPath(), PermissionType.READ);
try