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

126531 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      123163 jvonka: RA-706, ACE-5113: Platform - OwnableService - when setting owner check that username currently exists (at time of property update)
      - update Nodes API (remove extra check)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126875 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 12:01:38 +00:00
parent 3d53b94976
commit 2cfd6ee016
3 changed files with 2 additions and 19 deletions

View File

@@ -146,6 +146,7 @@
<entry key="org.alfresco.rest.framework.core.exceptions.DisabledServiceException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_IMPLEMENTED}" /> <entry key="org.alfresco.rest.framework.core.exceptions.DisabledServiceException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_NOT_IMPLEMENTED}" />
<entry key="org.alfresco.rest.framework.core.exceptions.InsufficientStorageException" value="507" /> <entry key="org.alfresco.rest.framework.core.exceptions.InsufficientStorageException" value="507" />
<entry key="org.alfresco.repo.node.integrity.IntegrityException" value="422" /> <entry key="org.alfresco.repo.node.integrity.IntegrityException" value="422" />
<entry key="org.alfresco.service.cmr.security.NoSuchPersonException" value="422" />
</map> </map>
</property> </property>
</bean> </bean>

View File

@@ -1273,8 +1273,6 @@ public class NodesImpl implements Nodes
} }
props.put(ContentModel.PROP_NAME, nodeName); props.put(ContentModel.PROP_NAME, nodeName);
validatePropValues(props);
QName assocQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, QName.createValidLocalName(nodeName)); QName assocQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, QName.createValidLocalName(nodeName));
try try
{ {
@@ -1301,20 +1299,6 @@ public class NodesImpl implements Nodes
} }
} }
// special cases: additional validation of property values (if not done by underlying foundation services)
private void validatePropValues(Map<QName, Serializable> props)
{
String newOwner = (String)props.get(ContentModel.PROP_OWNER);
if (newOwner != null)
{
// validate that user exists
if (! personService.personExists(newOwner))
{
throw new InvalidArgumentException("Unknown owner: "+newOwner);
}
}
}
@Override @Override
public Node updateNode(String nodeId, Node nodeInfo, Parameters parameters) public Node updateNode(String nodeId, Node nodeInfo, Parameters parameters)
{ {
@@ -1446,8 +1430,6 @@ public class NodesImpl implements Nodes
if (props.size() > 0) if (props.size() > 0)
{ {
validatePropValues(props);
try try
{ {
// update node properties - note: null will unset the specified property // update node properties - note: null will unset the specified property

View File

@@ -2010,7 +2010,7 @@ public class NodeApiTest extends AbstractBaseApiTest
dUpdate = new Document(); dUpdate = new Document();
dUpdate.setProperties(props); dUpdate.setProperties(props);
put(URL_NODES, user1, d1Id, toJsonAsStringNonNull(dUpdate), null, 400); put(URL_NODES, user1, d1Id, toJsonAsStringNonNull(dUpdate), null, 422);
AuthenticationUtil.setFullyAuthenticatedUser(user2); AuthenticationUtil.setFullyAuthenticatedUser(user2);