public class DefaultCurrentIdentityService extends Object implements CurrentIdentityService
Default implementation to run an action in the context of a given user and tenant. This implementation delegates to the configured CurrentUserService and CurrentTenantService.
| Constructor and Description |
|---|
DefaultCurrentIdentityService(CurrentUserService currentUserService,
CurrentTenantService currentTenantService) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
runAsUserInTenant(String userId,
String tenantId,
Callable<T> action)
Runs the given action in the context of the specified user sand tenant.
|
void |
runAsUserInTenant(String userId,
String tenantId,
Runnable action)
Runs the given action in the context of the specified user and tenant.
|
public DefaultCurrentIdentityService(CurrentUserService currentUserService, CurrentTenantService currentTenantService)
public void runAsUserInTenant(String userId, String tenantId, Runnable action)
CurrentIdentityServiceRuns the given action in the context of the specified user and tenant.
runAsUserInTenant in interface CurrentIdentityServiceuserId - the user id to applytenantId - the tenant id to applyaction - the action to executepublic <T> T runAsUserInTenant(String userId, String tenantId, Callable<T> action)
CurrentIdentityServiceRuns the given action in the context of the specified user sand tenant.
runAsUserInTenant in interface CurrentIdentityServiceT - the type of the callableuserId - the user id to applytenantId - the tenant id to applyaction - the action to executeCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.