From 6f60e2190d111a4627c6fece5c5d0e591c145e46 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 15 Mar 2007 11:34:20 +0000 Subject: [PATCH] Fixes for AWC-1160 and AWC-1161 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5389 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/model/permissionDefinitions.xml | 2 +- .../alfresco/repo/lock/LockServiceImpl.java | 34 ++++++------------- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/config/alfresco/model/permissionDefinitions.xml b/config/alfresco/model/permissionDefinitions.xml index 4f20c9e4f3..60465b61fd 100644 --- a/config/alfresco/model/permissionDefinitions.xml +++ b/config/alfresco/model/permissionDefinitions.xml @@ -314,7 +314,7 @@ - + diff --git a/source/java/org/alfresco/repo/lock/LockServiceImpl.java b/source/java/org/alfresco/repo/lock/LockServiceImpl.java index cadaa61b49..8b76223e95 100644 --- a/source/java/org/alfresco/repo/lock/LockServiceImpl.java +++ b/source/java/org/alfresco/repo/lock/LockServiceImpl.java @@ -284,28 +284,17 @@ public class LockServiceImpl implements LockService // Check for lock aspect checkForLockApsect(nodeRef); - // Get the current user name - //String userName = getUserName(); - - //LockStatus lockStatus = getLockStatus(nodeRef, userName); - //if (LockStatus.LOCKED.equals(lockStatus) == true) - // { - // // Error since the lock can only be released by the lock owner - // throw new UnableToReleaseLockException(nodeRef); - // } - // else if (LockStatus.LOCK_OWNER.equals(lockStatus) == true) - // { - this.ignoreNodeRefs.add(nodeRef); - try - { - // Clear the lock owner - this.nodeService.setProperty(nodeRef, ContentModel.PROP_LOCK_OWNER, null); - this.nodeService.setProperty(nodeRef, ContentModel.PROP_LOCK_TYPE, null); - } finally - { - this.ignoreNodeRefs.remove(nodeRef); - } - //} + this.ignoreNodeRefs.add(nodeRef); + try + { + // Clear the lock owner + this.nodeService.setProperty(nodeRef, ContentModel.PROP_LOCK_OWNER, null); + this.nodeService.setProperty(nodeRef, ContentModel.PROP_LOCK_TYPE, null); + } + finally + { + this.ignoreNodeRefs.remove(nodeRef); + } } /** @@ -361,7 +350,6 @@ public class LockServiceImpl implements LockService LockStatus result = LockStatus.NO_LOCK; if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE) == true) - { // Get the current lock owner String currentUserRef = (String) this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCK_OWNER);