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

57163: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3)
      57016: Reverse Merge to the original
         56761: Reverse Merge: Caused lots of build errors running SecurityTestSuite. Specifically HomeFolderProviderSynchronizerTest
               which ran after AuthorityBridgeTableAsynchronouslyRefreshedCacheTest.
               See https://bamboo.alfresco.com/bamboo/browse/ALF-ENTERPRISEV42BUGFIX-7 (#11 has 30 errors including 26 from HFPST and ABTARCT)
            56562: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1)
               56138: Merged DEV to V4.1-BUG-FIX (4.1.7)
                  56075: MNT-9375 (related to MNT-9485): MT - when users are added to site with a group addition versus individual, they are not handled as members of site
                  Added JUnit test for the issue. Added the test to SecurityTestSuite.
            56580: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1)
               56026: Merged DEV to V4.1-BUG-FIX (4.1.7)
                  55892: MNT-9485: MT Users added to Alfresco Administrators group via Group addition do not have 'admin' privileges
                   - Build bridge cache on behalf of provided tenant user. 
            56581: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1)
               << last commit missed a file >>
               56026: Merged DEV to V4.1-BUG-FIX (4.1.7)
                  55892: MNT-9485: MT Users added to Alfresco Administrators group via Group addition do not have 'admin' privileges
                   - Build bridge cache on behalf of provided tenant user. 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61780 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-11 20:14:29 +00:00
parent ed0e48861d
commit 7ec5353411
4 changed files with 159 additions and 7 deletions

View File

@@ -21,6 +21,9 @@ package org.alfresco.repo.security.authority;
import java.util.List;
import org.alfresco.repo.cache.AbstractAsynchronouslyRefreshedCache;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.tenant.TenantAdminService;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.util.BridgeTable;
@@ -35,6 +38,7 @@ public class AuthorityBridgeTableAsynchronouslyRefreshedCache extends AbstractAs
{
private AuthorityBridgeDAO authorityBridgeDAO;
private RetryingTransactionHelper retryingTransactionHelper;
private TenantAdminService tenantAdminService;
/**
* @param authorityBridgeDAO
@@ -54,17 +58,29 @@ public class AuthorityBridgeTableAsynchronouslyRefreshedCache extends AbstractAs
this.retryingTransactionHelper = retryingTransactionHelper;
}
public void setTenantAdminService(TenantAdminService tenantAdminService)
{
this.tenantAdminService = tenantAdminService;
}
@Override
protected BridgeTable<String> buildCache(final String tenantId)
{
return retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<BridgeTable<String>>()
return AuthenticationUtil.runAs(new RunAsWork<BridgeTable<String>>()
{
@Override
public BridgeTable<String> execute() throws Throwable
public BridgeTable<String> doWork() throws Exception
{
return doBuildCache(tenantId);
return retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<BridgeTable<String>>()
{
@Override
public BridgeTable<String> execute() throws Throwable
{
return doBuildCache(tenantId);
}
}, true, false);
}
}, true, false);
}, tenantAdminService.getDomainUser(AuthenticationUtil.getSystemUserName(), tenantId));
}
private BridgeTable<String> doBuildCache(String tenantId)