Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

106358: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud) (PARTIAL MERGE)
      106183: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.3)
         106133: Merged DEV to V4.2-BUG-FIX (4.2.5)
            104635: MNT-14035: Non-site members with granular permissions are missing privileges to documents/folders
               - Refuse of user permission checks for Site.getContainer() method. Minor changes for folder-actions.js to parentNodeRef property, when a user does not has permission to parent folder. Appropriate redirection to dashboard page in this case takes place here.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@106367 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-06-16 22:25:26 +00:00
parent e116899712
commit 54eab885f1

View File

@@ -502,22 +502,22 @@ public class Site implements Serializable
* @return node representing the "container" folder (or null, if for some reason
* the container can not be created - probably due to permissions)
*/
public ScriptNode getContainer(String componentId)
public ScriptNode getContainer(final String componentId)
{
ScriptNode container = null;
try
{
NodeRef containerNodeRef = this.siteService.getContainer(getShortName(), componentId);
if (containerNodeRef != null)
{
container = new ScriptNode(containerNodeRef, this.serviceRegistry, this.scope);
}
}
catch (AccessDeniedException ade)
ScriptNode container = null;
NodeRef containerNodeRef = AuthenticationUtil.runAs(new RunAsWork<NodeRef>()
{
return null;
public NodeRef doWork() throws Exception
{
return Site.this.siteService.getContainer(getShortName(), componentId);
}
}, AuthenticationUtil.SYSTEM_USER_NAME);
if (containerNodeRef != null)
{
container = new ScriptNode(containerNodeRef, this.serviceRegistry, this.scope);
}
return container;
return container;
}
/**