Merged 5.2.N (5.2.1) to HEAD (5.2)

129791 amorarasu: REPO-340 / REPO-1136 - V1 REST API: Unlock Node
      - Unlock with includeChildren=true - fixed + testcases


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130231 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 14:43:34 +00:00
parent 65f1f05d1f
commit d6491804d0
2 changed files with 127 additions and 90 deletions

View File

@@ -2996,18 +2996,7 @@ public class NodesImpl implements Nodes
unlockInfo.setAllowCheckedOut(false);
}
// If there is no lock placed on the node skip the operation.
if (lockService.getLockStatus(nodeRef) != LockStatus.NO_LOCK)
{
if (permissionService.hasPermission(nodeRef, PermissionService.UNLOCK).equals(AccessStatus.ALLOWED))
{
lockService.unlock(nodeRef, unlockInfo.getIncludeChildren(), unlockInfo.getAllowCheckedOut());
}
else
{
throw new PermissionDeniedException("Current user doesn't have permission to unlock node " + nodeId);
}
}
lockService.unlock(nodeRef, unlockInfo.getIncludeChildren(), unlockInfo.getAllowCheckedOut());
return getFolderOrDocument(nodeId, parameters);
}