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

129897 mmuller: Restrict lock method to content types. REPO-1158


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130239 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 14:44:50 +00:00
parent 772d2ffd57
commit dd8adcbd2f
2 changed files with 27 additions and 15 deletions

View File

@@ -2963,6 +2963,11 @@ public class NodesImpl implements Nodes
throw new PermissionDeniedException("Current user doesn't have permission to lock node " + nodeId);
}
if (!nodeMatches(nodeRef, Collections.singleton(ContentModel.TYPE_CONTENT), null, false))
{
throw new InvalidArgumentException("NodeId of content is expected: " + nodeRef.getId());
}
lockInfo = validateLockInformation(lockInfo);
lockService.lock(nodeRef, lockInfo.getMappedType(), lockInfo.getTimeToExpire(), lockInfo.getLifetime());