mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
REPO-2451 / MNT-17612: AccessDeniedException in AOS Edit Offline - Upload New Version
- Make sure ephemeral locks which are expired are ignored. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@136946 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2017 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -540,7 +540,7 @@ public class LockServiceImpl implements LockService,
|
||||
}
|
||||
finally
|
||||
{
|
||||
behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
lockableAspectInterceptor.enableForThread();
|
||||
removeFromIgnoreSet(nodeRef);
|
||||
}
|
||||
@@ -919,6 +919,18 @@ public class LockServiceImpl implements LockService,
|
||||
nodeRef = tenantService.getName(nodeRef);
|
||||
LockState lockState = lockStore.get(nodeRef);
|
||||
|
||||
if (lockState != null)
|
||||
{
|
||||
String lockOwner = lockState.getOwner();
|
||||
Date expiryDate = lockState.getExpires();
|
||||
LockStatus status = LockUtils.lockStatus(lockOwner, lockOwner, expiryDate);
|
||||
// in-memory ephemeral lock which is expired is irrelevant
|
||||
if (status.equals(LockStatus.LOCK_EXPIRED))
|
||||
{
|
||||
lockState = null;
|
||||
}
|
||||
}
|
||||
|
||||
//ALF-20361: It is possible that a rollback has resulted in a "non-lock" lock state being added to
|
||||
//the lock store. Because of that, we check both whether the retrieved lockState is null and, if it isn't,
|
||||
//whether it represents a real lock
|
||||
|
Reference in New Issue
Block a user