mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
128583 jvonka: V1 REST API: Node Version History - tweak "delete version" operation - cannot delete last version for now (return 422) REPO-835 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129173 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
package org.alfresco.rest.api.nodes;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.node.integrity.IntegrityException;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.repo.version.Version2Model;
|
||||
@@ -254,7 +255,11 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
|
||||
Map<QName, Serializable> props = sr.getNodeService().getProperties(nodeRef);
|
||||
if (props.get(ContentModel.PROP_VERSION_LABEL) == null)
|
||||
{
|
||||
// last version was deleted
|
||||
// attempt to delete last version - we do not yet support this (see REPO-835 & REPO-834)
|
||||
// note: alternatively, the client can remove the "cm:versionable" aspect (if permissions allow) to clear the version history and disable versioning
|
||||
throw new IntegrityException("Cannot delete last version (did you mean to disable versioning instead ?) ["+nodeId+","+versionId+"]", null);
|
||||
|
||||
/*
|
||||
if (props.get(ContentModel.PROP_VERSION_TYPE) != null)
|
||||
{
|
||||
// minor fix up to versionable aspect - ie. remove versionType
|
||||
@@ -270,6 +275,7 @@ public class NodeVersionsRelation extends AbstractNodeRelation implements
|
||||
behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_VERSIONABLE);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user