mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
MT - tenant bootstrap nows runs in 'System' ctx (rather than tenant 'admin' ctx) + minor cleanup.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8137 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -222,7 +222,11 @@ public class AuditableAspect
|
|||||||
String currentUserName = authenticationService.getCurrentUserName();
|
String currentUserName = authenticationService.getCurrentUserName();
|
||||||
if (currentUserName != null)
|
if (currentUserName != null)
|
||||||
{
|
{
|
||||||
return currentUserName;
|
if (tenantService.isEnabled() && authenticationService.isCurrentUserTheSystemUser())
|
||||||
|
{
|
||||||
|
return tenantService.getBaseNameUser(currentUserName);
|
||||||
|
}
|
||||||
|
return currentUserName;
|
||||||
}
|
}
|
||||||
return USERNAME_UNKNOWN;
|
return USERNAME_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
@@ -101,7 +101,7 @@ public class TenantRoutingFileContentStore extends AbstractRoutingContentStore i
|
|||||||
|
|
||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
String tenantDomain = "";
|
String tenantDomain = TenantService.DEFAULT_DOMAIN;
|
||||||
String rootDir = defaultRootDirectory;
|
String rootDir = defaultRootDirectory;
|
||||||
|
|
||||||
Tenant tenant = tenantService.getTenant(tenantService.getCurrentUserDomain());
|
Tenant tenant = tenantService.getTenant(tenantService.getCurrentUserDomain());
|
||||||
|
@@ -189,16 +189,6 @@ public class DictionaryDAOImpl implements DictionaryDAO
|
|||||||
logger.debug("Resetting dictionary ...");
|
logger.debug("Resetting dictionary ...");
|
||||||
}
|
}
|
||||||
|
|
||||||
String userName;
|
|
||||||
if (tenantDomain == "")
|
|
||||||
{
|
|
||||||
userName = AuthenticationUtil.getSystemUserName();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userName = tenantService.getDomainUser(TenantService.ADMIN_BASENAME, tenantDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
public Object doWork()
|
public Object doWork()
|
||||||
@@ -208,7 +198,7 @@ public class DictionaryDAOImpl implements DictionaryDAO
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, userName);
|
}, tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantDomain));
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
|
@@ -585,35 +585,30 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
|||||||
{
|
{
|
||||||
// shared model - need to check all tenants (whether enabled or disabled) unless they have overridden
|
// shared model - need to check all tenants (whether enabled or disabled) unless they have overridden
|
||||||
List<Tenant> tenants = tenantDeployerService.getAllTenants();
|
List<Tenant> tenants = tenantDeployerService.getAllTenants();
|
||||||
|
for (Tenant tenant : tenants)
|
||||||
if (tenants != null)
|
|
||||||
{
|
{
|
||||||
for (Tenant tenant : tenants)
|
// validate model delete within context of tenant domain
|
||||||
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
// switch to admin in order to validate model delete within context of tenant domain
|
public Object doWork()
|
||||||
// assumes each tenant has default "admin" user
|
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
|
||||||
{
|
{
|
||||||
public Object doWork()
|
if (dictionaryDAO.isModelInherited(modelName))
|
||||||
{
|
{
|
||||||
if (dictionaryDAO.isModelInherited(modelName))
|
validateModelDelete(modelName, true);
|
||||||
{
|
|
||||||
validateModelDelete(modelName, true);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}, tenantService.getDomainUser(TenantService.ADMIN_BASENAME, tenant.getTenantDomain()));
|
return null;
|
||||||
}
|
}
|
||||||
|
}, tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenant.getTenantDomain()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateModelDelete(QName modelName, boolean sharedModel)
|
private void validateModelDelete(QName modelName, boolean sharedModel)
|
||||||
{
|
{
|
||||||
String tenantDomainCtx = "";
|
String tenantDomain = TenantService.DEFAULT_DOMAIN;
|
||||||
if (sharedModel)
|
if (sharedModel)
|
||||||
{
|
{
|
||||||
tenantDomainCtx = " for tenant [" + tenantService.getCurrentUserDomain() + "]";
|
tenantDomain = " for tenant [" + tenantService.getCurrentUserDomain() + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
// check workflow namespace usage
|
// check workflow namespace usage
|
||||||
@@ -625,7 +620,7 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
|||||||
{
|
{
|
||||||
if (workflowNamespaceURI.equals(namespace.getUri()))
|
if (workflowNamespaceURI.equals(namespace.getUri()))
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Failed to validate model delete" + tenantDomainCtx + " - found workflow process definition " + workflowDefName + " using model namespace '" + namespace.getUri() + "'");
|
throw new AlfrescoRuntimeException("Failed to validate model delete" + tenantDomain + " - found workflow process definition " + workflowDefName + " using model namespace '" + namespace.getUri() + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -633,17 +628,17 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
|||||||
// check for type usages
|
// check for type usages
|
||||||
for (TypeDefinition type : dictionaryDAO.getTypes(modelName))
|
for (TypeDefinition type : dictionaryDAO.getTypes(modelName))
|
||||||
{
|
{
|
||||||
validateClass(tenantDomainCtx, type);
|
validateClass(tenantDomain, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for aspect usages
|
// check for aspect usages
|
||||||
for (AspectDefinition aspect : dictionaryDAO.getAspects(modelName))
|
for (AspectDefinition aspect : dictionaryDAO.getAspects(modelName))
|
||||||
{
|
{
|
||||||
validateClass(tenantDomainCtx, aspect);
|
validateClass(tenantDomain, aspect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateClass(String tenantDomainCtx, ClassDefinition classDef)
|
private void validateClass(String tenantDomain, ClassDefinition classDef)
|
||||||
{
|
{
|
||||||
QName className = classDef.getName();
|
QName className = classDef.getName();
|
||||||
|
|
||||||
@@ -661,7 +656,7 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
|||||||
ResultSet rs = searchService.query(store, SearchService.LANGUAGE_LUCENE, classType+":\""+className+"\"");
|
ResultSet rs = searchService.query(store, SearchService.LANGUAGE_LUCENE, classType+":\""+className+"\"");
|
||||||
if (rs.length() > 0)
|
if (rs.length() > 0)
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Failed to validate model delete" + tenantDomainCtx + " - found " + rs.length() + " nodes in store " + store + " with " + classType + " '" + className + "'" );
|
throw new AlfrescoRuntimeException("Failed to validate model delete" + tenantDomain + " - found " + rs.length() + " nodes in store " + store + " with " + classType + " '" + className + "'" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -673,7 +668,7 @@ public class DictionaryModelType implements ContentServicePolicies.OnContentUpda
|
|||||||
TypeDefinition workflowTypeDef = workflowTaskDef.metadata;
|
TypeDefinition workflowTypeDef = workflowTaskDef.metadata;
|
||||||
if (workflowTypeDef.getName().toString().equals(className))
|
if (workflowTypeDef.getName().toString().equals(className))
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException("Failed to validate model delete" + tenantDomainCtx + " - found task definition in workflow " + workflowDef.getName() + " with " + classType + " '" + className + "'");
|
throw new AlfrescoRuntimeException("Failed to validate model delete" + tenantDomain + " - found task definition in workflow " + workflowDef.getName() + " with " + classType + " '" + className + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -816,16 +816,6 @@ public class MessageServiceImpl implements MessageService
|
|||||||
logger.debug("Resetting messages ...");
|
logger.debug("Resetting messages ...");
|
||||||
}
|
}
|
||||||
|
|
||||||
String userName;
|
|
||||||
if (tenantDomain == "")
|
|
||||||
{
|
|
||||||
userName = AuthenticationUtil.getSystemUserName();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
userName = tenantService.getDomainUser(TenantService.ADMIN_BASENAME, tenantDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
public Object doWork()
|
public Object doWork()
|
||||||
@@ -840,7 +830,7 @@ public class MessageServiceImpl implements MessageService
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, userName);
|
}, tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantDomain));
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
|
@@ -224,27 +224,24 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
int enabledCount = 0;
|
int enabledCount = 0;
|
||||||
int disabledCount = 0;
|
int disabledCount = 0;
|
||||||
|
|
||||||
if (tenants != null)
|
for (Tenant tenant : tenants)
|
||||||
{
|
{
|
||||||
for (Tenant tenant : tenants)
|
if (tenant.isEnabled())
|
||||||
{
|
{
|
||||||
if (tenant.isEnabled())
|
// this will also call tenant deployers registered so far ...
|
||||||
{
|
enableTenant(tenant.getTenantDomain(), true);
|
||||||
// this will also call tenant deployers registered so far ...
|
enabledCount++;
|
||||||
enableTenant(tenant.getTenantDomain(), true);
|
}
|
||||||
enabledCount++;
|
else
|
||||||
}
|
{
|
||||||
else
|
// explicitly disable, without calling disableTenant callback
|
||||||
{
|
disableTenant(tenant.getTenantDomain(), false);
|
||||||
// explicitly disable, without calling disableTenant callback
|
disabledCount++;
|
||||||
disableTenant(tenant.getTenantDomain(), false);
|
|
||||||
disabledCount++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tenantService.register(this); // callback to refresh tenantStatus cache
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tenantService.register(this); // callback to refresh tenantStatus cache
|
||||||
|
|
||||||
userTransaction.commit();
|
userTransaction.commit();
|
||||||
|
|
||||||
if (logger.isInfoEnabled())
|
if (logger.isInfoEnabled())
|
||||||
@@ -336,7 +333,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, getTenantAdminUser(tenantDomain));
|
}, getSystemUser(tenantDomain));
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Tenant created: " + tenantDomain);
|
logger.info("Tenant created: " + tenantDomain);
|
||||||
@@ -354,7 +351,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
repositoryExporterService.export(directoryDestination, tenantDomain);
|
repositoryExporterService.export(directoryDestination, tenantDomain);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, getTenantAdminUser(tenantDomain));
|
}, getSystemUser(tenantDomain));
|
||||||
|
|
||||||
logger.info("Tenant exported: " + tenantDomain);
|
logger.info("Tenant exported: " + tenantDomain);
|
||||||
}
|
}
|
||||||
@@ -409,7 +406,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, getTenantAdminUser(tenantDomain));
|
}, getSystemUser(tenantDomain));
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Tenant imported: " + tenantDomain);
|
logger.info("Tenant imported: " + tenantDomain);
|
||||||
@@ -489,7 +486,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, getTenantAdminUser(tenantDomain));
|
}, getSystemUser(tenantDomain));
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Tenant enabled: " + tenantDomain);
|
logger.info("Tenant enabled: " + tenantDomain);
|
||||||
@@ -520,7 +517,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, getTenantAdminUser(tenantDomain));
|
}, getSystemUser(tenantDomain));
|
||||||
}
|
}
|
||||||
|
|
||||||
// update tenant attributes / tenant cache - need to disable after notifying listeners (else they cannot disable)
|
// update tenant attributes / tenant cache - need to disable after notifying listeners (else they cannot disable)
|
||||||
@@ -580,7 +577,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
workflowDeployer.init();
|
workflowDeployer.init();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, getTenantAdminUser(tenantDomain));
|
}, getSystemUser(tenantDomain));
|
||||||
|
|
||||||
logger.info("Tenant workflows bootstrapped: " + tenantDomain);
|
logger.info("Tenant workflows bootstrapped: " + tenantDomain);
|
||||||
}
|
}
|
||||||
@@ -598,8 +595,6 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String tenantAdminUser = getTenantAdminUser(tenantDomain);
|
|
||||||
|
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
public Object doWork()
|
public Object doWork()
|
||||||
@@ -633,8 +628,9 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, tenantAdminUser);
|
}, getSystemUser(tenantDomain));
|
||||||
|
|
||||||
|
final String tenantAdminUser = getTenantAdminUser(tenantDomain);
|
||||||
|
|
||||||
// delete tenant-specific stores
|
// delete tenant-specific stores
|
||||||
nodeService.deleteStore(tenantService.getName(tenantAdminUser, new StoreRef(PROTOCOL_STORE_WORKSPACE, STORE_BASE_ID_SPACES)));
|
nodeService.deleteStore(tenantService.getName(tenantAdminUser, new StoreRef(PROTOCOL_STORE_WORKSPACE, STORE_BASE_ID_SPACES)));
|
||||||
@@ -655,7 +651,7 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, tenantAdminUser);
|
}, getSystemUser(tenantDomain));
|
||||||
|
|
||||||
// remove tenant
|
// remove tenant
|
||||||
attributeService.removeAttribute(TENANTS_ATTRIBUTE_PATH, tenantDomain);
|
attributeService.removeAttribute(TENANTS_ATTRIBUTE_PATH, tenantDomain);
|
||||||
@@ -911,46 +907,43 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
|
|
||||||
String currentUser = AuthenticationUtil.getCurrentUserName();
|
String currentUser = AuthenticationUtil.getCurrentUserName();
|
||||||
|
|
||||||
if (tenants != null)
|
try
|
||||||
{
|
{
|
||||||
try
|
for (Tenant tenant : tenants)
|
||||||
{
|
{
|
||||||
for (Tenant tenant : tenants)
|
if (tenant.isEnabled())
|
||||||
{
|
{
|
||||||
if (tenant.isEnabled())
|
try
|
||||||
{
|
{
|
||||||
try
|
// switch to admin in order to deploy within context of tenant domain
|
||||||
|
// assumes each tenant has default "admin" user
|
||||||
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
// switch to admin in order to deploy within context of tenant domain
|
public Object doWork()
|
||||||
// assumes each tenant has default "admin" user
|
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
|
||||||
{
|
{
|
||||||
public Object doWork()
|
// init the service within tenant context
|
||||||
{
|
deployer.init();
|
||||||
// init the service within tenant context
|
return null;
|
||||||
deployer.init();
|
}
|
||||||
return null;
|
}, getSystemUser(tenant.getTenantDomain()));
|
||||||
}
|
|
||||||
}, getTenantAdminUser(tenant.getTenantDomain()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
logger.error("Deployment failed" + e);
|
logger.error("Deployment failed" + e);
|
||||||
|
|
||||||
StringWriter stringWriter = new StringWriter();
|
StringWriter stringWriter = new StringWriter();
|
||||||
e.printStackTrace(new PrintWriter(stringWriter));
|
e.printStackTrace(new PrintWriter(stringWriter));
|
||||||
logger.error(stringWriter.toString());
|
logger.error(stringWriter.toString());
|
||||||
|
|
||||||
// tenant deploy failure should not necessarily affect other tenants
|
// tenant deploy failure should not necessarily affect other tenants
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
}
|
||||||
{
|
finally
|
||||||
if (currentUser != null) { AuthenticationUtil.setCurrentUser(currentUser); }
|
{
|
||||||
}
|
if (currentUser != null) { AuthenticationUtil.setCurrentUser(currentUser); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -988,46 +981,43 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
|
|
||||||
String currentUser = AuthenticationUtil.getCurrentUserName();
|
String currentUser = AuthenticationUtil.getCurrentUserName();
|
||||||
|
|
||||||
if (tenants != null)
|
try
|
||||||
{
|
{
|
||||||
try
|
for (Tenant tenant : tenants)
|
||||||
{
|
{
|
||||||
for (Tenant tenant : tenants)
|
if (tenant.isEnabled())
|
||||||
{
|
{
|
||||||
if (tenant.isEnabled())
|
try
|
||||||
{
|
{
|
||||||
try
|
// switch to admin in order to deploy within context of tenant domain
|
||||||
|
// assumes each tenant has default "admin" user
|
||||||
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
// switch to admin in order to deploy within context of tenant domain
|
public Object doWork()
|
||||||
// assumes each tenant has default "admin" user
|
|
||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
|
||||||
{
|
{
|
||||||
public Object doWork()
|
// destroy the service within tenant context
|
||||||
{
|
deployer.destroy();
|
||||||
// destroy the service within tenant context
|
return null;
|
||||||
deployer.destroy();
|
}
|
||||||
return null;
|
}, getSystemUser(tenant.getTenantDomain()));
|
||||||
}
|
|
||||||
}, getTenantAdminUser(tenant.getTenantDomain()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
logger.error("Undeployment failed" + e);
|
logger.error("Undeployment failed" + e);
|
||||||
|
|
||||||
StringWriter stringWriter = new StringWriter();
|
StringWriter stringWriter = new StringWriter();
|
||||||
e.printStackTrace(new PrintWriter(stringWriter));
|
e.printStackTrace(new PrintWriter(stringWriter));
|
||||||
logger.error(stringWriter.toString());
|
logger.error(stringWriter.toString());
|
||||||
|
|
||||||
// tenant undeploy failure should not necessarily affect other tenants
|
// tenant undeploy failure should not necessarily affect other tenants
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
}
|
||||||
{
|
finally
|
||||||
if (currentUser != null) { AuthenticationUtil.setCurrentUser(currentUser); }
|
{
|
||||||
}
|
if (currentUser != null) { AuthenticationUtil.setCurrentUser(currentUser); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1114,13 +1104,18 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// local helper
|
// local helpers
|
||||||
|
|
||||||
|
private String getSystemUser(String tenantDomain)
|
||||||
|
{
|
||||||
|
return tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantDomain);
|
||||||
|
}
|
||||||
|
|
||||||
private String getTenantAdminUser(String tenantDomain)
|
private String getTenantAdminUser(String tenantDomain)
|
||||||
{
|
{
|
||||||
return tenantService.getDomainUser(ADMIN_BASENAME, tenantDomain);
|
return tenantService.getDomainUser(ADMIN_BASENAME, tenantDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
// local helper
|
|
||||||
private String getTenantGuestUser(String tenantDomain)
|
private String getTenantGuestUser(String tenantDomain)
|
||||||
{
|
{
|
||||||
return tenantService.getDomainUser(authenticationComponent.getGuestUserName(), tenantDomain);
|
return tenantService.getDomainUser(authenticationComponent.getGuestUserName(), tenantDomain);
|
||||||
|
@@ -485,9 +485,12 @@ public class MultiTServiceImpl implements TenantService
|
|||||||
{
|
{
|
||||||
// Check that all the passed values are not null
|
// Check that all the passed values are not null
|
||||||
ParameterCheck.mandatory("baseUsername", baseUsername);
|
ParameterCheck.mandatory("baseUsername", baseUsername);
|
||||||
ParameterCheck.mandatory("tenantDomain", tenantDomain);
|
|
||||||
|
|
||||||
if (! tenantDomain.equals(DEFAULT_DOMAIN))
|
if ((tenantDomain == null) || (tenantDomain.equals(DEFAULT_DOMAIN)))
|
||||||
|
{
|
||||||
|
return baseUsername;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (baseUsername.contains(SEPARATOR))
|
if (baseUsername.contains(SEPARATOR))
|
||||||
{
|
{
|
||||||
@@ -501,10 +504,6 @@ public class MultiTServiceImpl implements TenantService
|
|||||||
|
|
||||||
return baseUsername + SEPARATOR + tenantDomain;
|
return baseUsername + SEPARATOR + tenantDomain;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return baseUsername;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void checkTenantEnabled(String tenantDomain)
|
protected void checkTenantEnabled(String tenantDomain)
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.tenant;
|
package org.alfresco.repo.tenant;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@@ -56,6 +57,6 @@ public class SingleTDeployerServiceImpl implements TenantDeployerService
|
|||||||
|
|
||||||
public List<Tenant> getAllTenants()
|
public List<Tenant> getAllTenants()
|
||||||
{
|
{
|
||||||
return null;
|
return new ArrayList<Tenant>(0); // empty list
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user