MT - fix SLNG-1183

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10890 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-09-11 22:52:08 +00:00
parent 8f2f0ed14f
commit 3ca446e81e
6 changed files with 42 additions and 9 deletions

View File

@@ -1139,7 +1139,7 @@ public class MultiTAdminServiceImpl implements TenantAdminService, ApplicationCo
}
}
// tenant deployer services delegated to tenant service
// tenant deployer/user services delegated to tenant service
public boolean isEnabled()
{
@@ -1151,6 +1151,11 @@ public class MultiTAdminServiceImpl implements TenantAdminService, ApplicationCo
return tenantService.getCurrentUserDomain();
}
public String getUserDomain(String username)
{
return tenantService.getUserDomain(username);
}
public String getDomainUser(String baseUsername, String tenantDomain)
{
return tenantService.getDomainUser(baseUsername, tenantDomain);

View File

@@ -109,6 +109,14 @@ public class SingleTAdminServiceImpl implements TenantAdminService
return TenantService.DEFAULT_DOMAIN;
}
/**
* @return Returns {@link TenantService#DEFAULT_DOMAIN} always
*/
public String getUserDomain(String username)
{
return TenantService.DEFAULT_DOMAIN;
}
/**
* @return Returns the given <tt>baseUserName</tt> always
*/

View File

@@ -3,7 +3,7 @@ package org.alfresco.repo.tenant;
/**
* Interface for Tenant User-Domain functionality.
*
* @author Jan Vonka
* @author janv
* @author Derek Hulley
* @since 3.0
*/
@@ -11,9 +11,11 @@ public interface TenantUserService
{
public String getCurrentUserDomain();
public String getDomain(String name);
public String getUserDomain(String username);
public String getDomainUser(String baseUsername, String tenantDomain);
public String getDomain(String name);
public boolean isEnabled();
}

View File

@@ -254,9 +254,16 @@ public class UserUsageTrackingComponent
// execute in READ-ONLY txn
final Set<String> userNames = txnHelper.doInTransaction(getAllPeople, true);
for (String userName : userNames)
for (final String userName : userNames)
{
recalculateUsage(userName);
AuthenticationUtil.runAs(new RunAsWork<Object>()
{
public Object doWork() throws Exception
{
recalculateUsage(userName);
return null;
}
}, tenantAdminService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantAdminService.getUserDomain(userName)));
}
if (logger.isDebugEnabled())