Fix for tenant-specific WebClient (fix for r6645)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6667 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2007-09-03 14:25:44 +00:00
parent ffc06927b4
commit 4bbebc0f32

View File

@@ -133,6 +133,8 @@ public final class Repository
*/
public static NodeRef getCompanyRoot(final FacesContext context)
{
final String currentUserName = Application.getCurrentUser(context).getUserName();
// note: run in context of System user using tenant-specific store
// so that Company Root can be returned, even if the user does not have
// permission to access the Company Root (including, for example, the Guest user)
@@ -145,7 +147,7 @@ public final class Repository
TenantService tenantService = (TenantService)FacesContextUtils.getRequiredWebApplicationContext(context).getBean("tenantService");
// get store ref (from config)
StoreRef storeRef = tenantService.getName(Repository.getStoreRef());
StoreRef storeRef = tenantService.getName(currentUserName, Repository.getStoreRef());
// get root path (from config)
String rootPath = Application.getRootPath(context);