Account lock = document.getUserLock();
// Check if Resource is already locked.
if (lock == null) {
LOG.debug(String.format("Resource %s is not locked.", xmldbUri));
throw new DocumentNotLockedException("" + xmldbUri);
}
// Check if Resource is from subject
if (!lock.getName().equals(subject.getName()) && !subject.hasDbaRole() ) {
LOG.debug(String.format("Resource lock is from user %s", lock.getName()));