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)
CurrentIdentityService
Runs the given action in the context of the specified user and tenant.
runAsUserInTenant
in interface CurrentIdentityService
userId
- the user id to applytenantId
- the tenant id to applyaction
- the action to executepublic <T> T runAsUserInTenant(String userId, String tenantId, Callable<T> action)
CurrentIdentityService
Runs the given action in the context of the specified user sand tenant.
runAsUserInTenant
in interface CurrentIdentityService
T
- 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.