mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
ALF-12866: WebDAV in-memory locking. Exclusive lock should be unlocked only by owner.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34174 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -151,19 +151,30 @@ public class UnlockMethod extends WebDAVMethod
|
||||
m_response.setStatus(HttpServletResponse.SC_NO_CONTENT);
|
||||
removeNoContentAspect(nodeRef);
|
||||
}
|
||||
else if (lockInfo.isExclusive() /* && user is lock-owner */)
|
||||
else if (lockInfo.isExclusive())
|
||||
{
|
||||
getLockStore().remove(nodeRef);
|
||||
|
||||
// Indicate that the unlock was successful
|
||||
m_response.setStatus(HttpServletResponse.SC_NO_CONTENT);
|
||||
|
||||
removeNoContentAspect(nodeRef);
|
||||
|
||||
// DEBUG
|
||||
if (logger.isDebugEnabled())
|
||||
String currentUser = getAuthenticationService().getCurrentUserName();
|
||||
if (currentUser.equals(lockInfo.getOwner()))
|
||||
{
|
||||
logger.debug("Unlock token=" + getLockToken() + " Successful");
|
||||
getLockStore().remove(nodeRef);
|
||||
|
||||
// Indicate that the unlock was successful
|
||||
m_response.setStatus(HttpServletResponse.SC_NO_CONTENT);
|
||||
removeNoContentAspect(nodeRef);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Unlock token=" + getLockToken() + " Successful");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Unlock token=" + getLockToken() + " Not lock owner");
|
||||
}
|
||||
// Node is not locked
|
||||
throw new WebDAVServerException(HttpServletResponse.SC_PRECONDITION_FAILED);
|
||||
}
|
||||
}
|
||||
else if (lockInfo.isShared())
|
||||
|
Reference in New Issue
Block a user