Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)

122817 jvonka: (Quick) Shared Links API - retrieve rendition content (no auth required)
   - TODO add extra test
   RA-830


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126511 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-05-10 11:17:21 +00:00
parent 39bbd9bacf
commit 119a8acf4d
6 changed files with 52 additions and 7 deletions

View File

@@ -39,6 +39,7 @@ import org.alfresco.rest.framework.core.exceptions.ApiException;
import org.alfresco.rest.framework.jacksonextensions.JacksonHelper;
import org.alfresco.rest.framework.resource.actions.ActionExecutor;
import org.alfresco.rest.framework.resource.actions.interfaces.BinaryResourceAction;
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceBinaryAction;
import org.alfresco.rest.framework.resource.content.BinaryResource;
import org.alfresco.rest.framework.resource.content.ContentInfo;
import org.alfresco.rest.framework.resource.content.FileBinaryResource;
@@ -105,7 +106,21 @@ public abstract class AbstractResourceWebScript extends ApiWebScript implements
if (toSerialize instanceof BinaryResource)
{
// TODO review (experimental) - can we move earlier & wrap complete execute ? Also for QuickShare (in MT/Cloud) needs to be tenant for the nodeRef (TBC).
boolean noAuth = resource.getMetaData().isNoAuth(BinaryResourceAction.Read.class);
boolean noAuth = false;
if (BinaryResourceAction.Read.class.isAssignableFrom(resource.getResource().getClass()))
{
noAuth = resource.getMetaData().isNoAuth(BinaryResourceAction.Read.class);
}
else if (RelationshipResourceBinaryAction.Read.class.isAssignableFrom(resource.getResource().getClass()))
{
noAuth = resource.getMetaData().isNoAuth(RelationshipResourceBinaryAction.Read.class);
}
else
{
logger.warn("Unexpected");
}
if (noAuth)
{
String networkTenantDomain = TenantUtil.getCurrentDomain();