diff --git a/source/java/org/alfresco/repo/config/xml/RepoXMLConfigService.java b/source/java/org/alfresco/repo/config/xml/RepoXMLConfigService.java index 4bcdfe8faa..2b43a51525 100644 --- a/source/java/org/alfresco/repo/config/xml/RepoXMLConfigService.java +++ b/source/java/org/alfresco/repo/config/xml/RepoXMLConfigService.java @@ -117,7 +117,7 @@ public class RepoXMLConfigService extends XMLConfigService implements TenantDepl return null; } }; - RunAsWork getConfigRunAs = new RunAsWork() + TenantUtil.TenantRunAsWork getConfigRunAs = new TenantUtil.TenantRunAsWork() { @Override public Void doWork() throws Exception @@ -138,8 +138,8 @@ public class RepoXMLConfigService extends XMLConfigService implements TenantDepl // Put some mutable config onto the current thread and have the superclasses mess with that. ConfigData configData = new ConfigData(); configUnderConstruction.set(configData); - // Do the work - AuthenticationUtil.runAsSystem(getConfigRunAs); + // Do the work as system tenant, see ALF-19922 + TenantUtil.runAsSystemTenant(getConfigRunAs, tenantDomain); // Now wrap the config so that it cannot be changed configData = new ImmutableConfigData(configData); // Done @@ -326,6 +326,6 @@ public class RepoXMLConfigService extends XMLConfigService implements TenantDepl @Override protected void removeElementReaders() { - throw new UnsupportedOperationException("'destroy' method must destroy all config. Piecemeal destruction is not supported."); + throw new UnsupportedOperationException("'destroy' method must destroy all config. Piecemeal destruction is not supported."); } }