if (userLock.getName() != null && !userLock.getName().equals(subject.getName())
&& !subject.hasDbaRole()) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Resource is locked by %s", userLock.getName()));
}
throw new PermissionDeniedException(userLock.getName());
}
LockToken lockToken = document.getMetadata().getLockToken();
if (!token.equals(lockToken.getOpaqueLockToken())) {
if (LOG.isDebugEnabled()) {
LOG.debug("Token does not match");
}
throw new PermissionDeniedException(String.format("Token %s does not match %s", token, lockToken.getOpaqueLockToken()));
}
lockToken.setTimeOut(LockToken.LOCK_TIMEOUT_INFINITE);
// Make token persistant