REPO-1681 / MNT-17228: CMIS: Attempt to delete non-current version throws "Unexpected: current version does not appear ..."

- code review change.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133961 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-12-21 10:07:16 +00:00
parent 5d546877f2
commit 934fd3414e

View File

@@ -1785,8 +1785,9 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
}
else if (info.isVariant(CMISObjectVariant.VERSION))
{
// Check the DELETE permission since the version service has no restrictions.
if (connector.getServiceRegistry().getPermissionService().hasPermission(nodeRef, PermissionService.DELETE) != AccessStatus.ALLOWED)
// Check the DELETE permission since the version service has no restrictions.
AccessStatus perm = connector.getServiceRegistry().getPermissionService().hasPermission(nodeRef, PermissionService.DELETE);
if (AccessStatus.ALLOWED != perm)
{
throw new CmisPermissionDeniedException("Cannot delete the node version.");
}
@@ -1811,7 +1812,8 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
}
else
{
if (connector.getServiceRegistry().getPermissionService().hasPermission(nodeRef, PermissionService.DELETE) != AccessStatus.ALLOWED)
AccessStatus perm = connector.getServiceRegistry().getPermissionService().hasPermission(nodeRef, PermissionService.DELETE);
if (AccessStatus.ALLOWED != perm)
{
throw new CmisPermissionDeniedException("Cannot delete the node version.");
}