mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
128382 jvonka: MNT-16446: Edit Comment permission (part 3b) - follow-on to fix test fallout - for CMIS (and future v1 Nodes REST) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@128387 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -145,6 +145,7 @@
|
|||||||
<entry key="org.alfresco.repo.security.permissions.AccessDeniedException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_FORBIDDEN}" />
|
<entry key="org.alfresco.repo.security.permissions.AccessDeniedException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_FORBIDDEN}" />
|
||||||
<entry key="org.alfresco.rest.framework.core.exceptions.UnsupportedResourceOperationException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_METHOD_NOT_ALLOWED}" />
|
<entry key="org.alfresco.rest.framework.core.exceptions.UnsupportedResourceOperationException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_METHOD_NOT_ALLOWED}" />
|
||||||
<entry key="org.alfresco.rest.framework.core.exceptions.ConstraintViolatedException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_CONFLICT}" />
|
<entry key="org.alfresco.rest.framework.core.exceptions.ConstraintViolatedException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_CONFLICT}" />
|
||||||
|
<entry key="org.alfresco.service.cmr.lock.NodeLockedException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_CONFLICT}" />
|
||||||
<entry key="org.alfresco.rest.framework.core.exceptions.StaleEntityException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_CONFLICT}" />
|
<entry key="org.alfresco.rest.framework.core.exceptions.StaleEntityException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_CONFLICT}" />
|
||||||
<entry key="org.alfresco.rest.framework.core.exceptions.RequestEntityTooLargeException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_REQUEST_ENTITY_TOO_LARGE}" />
|
<entry key="org.alfresco.rest.framework.core.exceptions.RequestEntityTooLargeException" value="#{T(org.springframework.extensions.webscripts.Status).STATUS_REQUEST_ENTITY_TOO_LARGE}" />
|
||||||
<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}" />
|
||||||
|
@@ -803,35 +803,33 @@ public class TestNodeComments extends EnterpriseTestApi
|
|||||||
}
|
}
|
||||||
catch(PublicApiException e)
|
catch(PublicApiException e)
|
||||||
{
|
{
|
||||||
assertEquals(HttpStatus.SC_FORBIDDEN, e.getHttpResponse().getStatusCode());
|
assertEquals(HttpStatus.SC_CONFLICT, e.getHttpResponse().getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
// test PUT for a locked node
|
// test PUT for a locked node
|
||||||
|
try
|
||||||
{
|
{
|
||||||
TenantUtil.runAsUserTenant(new TenantRunAsWork<Void>()
|
Comment updatedComment = new Comment();
|
||||||
{
|
updatedComment.setContent("my comment");
|
||||||
@Override
|
commentsProxy.updateNodeComment(nodeRef1.getId(), createdComment.getId(), updatedComment);
|
||||||
public Void doWork() throws Exception
|
|
||||||
{
|
|
||||||
repoService.lockNode(nodeRef1);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}, person11.getId(), network1.getId());
|
|
||||||
|
|
||||||
try
|
fail("");
|
||||||
{
|
}
|
||||||
publicApiClient.setRequestContext(new RequestContext(network1.getId(), person11.getId()));
|
catch(PublicApiException e)
|
||||||
|
{
|
||||||
|
assertEquals(HttpStatus.SC_CONFLICT, e.getHttpResponse().getStatusCode());
|
||||||
|
}
|
||||||
|
|
||||||
Comment updatedComment = new Comment();
|
// test DELETE for a locked node
|
||||||
updatedComment.setContent("my comment");
|
try
|
||||||
commentsProxy.updateNodeComment(nodeRef1.getId(), createdComment.getId(), updatedComment);
|
{
|
||||||
|
commentsProxy.removeNodeComment(nodeRef1.getId(), createdComment.getId());
|
||||||
|
|
||||||
fail("");
|
fail("");
|
||||||
}
|
}
|
||||||
catch(PublicApiException e)
|
catch(PublicApiException e)
|
||||||
{
|
{
|
||||||
assertEquals(HttpStatus.SC_FORBIDDEN, e.getHttpResponse().getStatusCode());
|
assertEquals(HttpStatus.SC_CONFLICT, e.getHttpResponse().getStatusCode());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
Reference in New Issue
Block a user