Merged 5.2.0 (5.2.0) to HEAD (5.2)

133746 cturlica: REPO-1758: 5.2 (merge): ACE-5706: Users are denied access to content they should be able to see in v1 REST API
      Merged 5.2.N (5.2.1) to 5.2.0 (5.2.0)
         133619 jvonka: REPO-1709: V1 REST API -  fix download content (fails unexpectedly with 403)
            - introduced by REPO-265


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@134178 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2017-01-11 10:33:24 +00:00
parent 83a8b9a09b
commit 62038af3ee
2 changed files with 77 additions and 4 deletions

View File

@@ -1978,7 +1978,7 @@ public class NodesImpl implements Nodes
}
/**
* Posts activites based on the activity_type.
* Posts activities based on the activity_type.
* If the method is called with aSync=true then a TransactionListener is used post the activity
* afterCommit. Otherwise the activity posting is done synchronously.
* @param activity_type
@@ -2009,9 +2009,19 @@ public class NodesImpl implements Nodes
}
}
// note: see also org.alfresco.opencmis.ActivityPosterImpl
protected ActivityInfo getActivityInfo(NodeRef parentNodeRef, NodeRef nodeRef)
{
SiteInfo siteInfo = siteService.getSite(nodeRef);
// runAs system, eg. user may not have permission see one or more parents (irrespective of whether in a site context of not)
SiteInfo siteInfo = AuthenticationUtil.runAs(new RunAsWork<SiteInfo>()
{
@Override
public SiteInfo doWork() throws Exception
{
return siteService.getSite(nodeRef);
}
}, AuthenticationUtil.getSystemUserName());
String siteId = (siteInfo != null ? siteInfo.getShortName() : null);
if(siteId != null && !siteId.equals(""))
{