Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD:

43124: Merged BRANCHES/DEV/FEATURES/CLOUD1_DISCUSSIONS to BRANCHES/DEV/V4.1-BUG-FIX:
        43059: CLOUD-864: Use base node ref, instead of tenant specific node ref for building list of replies (ALF-16498)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43125 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2012-10-26 09:30:15 +00:00
parent b794365eaa
commit de47da1766
4 changed files with 233 additions and 13 deletions

View File

@@ -72,6 +72,26 @@ public class TenantUtil
}
}
/**
* Execute a unit of work in a given tenant context. The thread's tenant context will be returned to its normal state
* after the call.
*
* @param runAsWork the unit of work to do
* @param uid the user ID
* @param tenanDomain the tenant domain
* @return Returns the work's return value
*/
public static <R> R runAsUserTenant(final TenantRunAsWork<R> runAsWork, final String uid, final String tenantDomain)
{
return AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<R>()
{
public R doWork()
{
return runAsTenant(runAsWork, tenantDomain);
}
}, uid);
}
/**
* Execute a unit of work in a given tenant context. The thread's tenant context will be returned to its normal state
* after the call.