public final class DefaultCurrentIdentityService extends Object implements CurrentIdentityService
CurrentUserService
and CurrentTenantService
.Constructor and Description |
---|
DefaultCurrentIdentityService(CurrentUserService currentUserService,
CurrentTenantService currentTenantService) |
Modifier and Type | Method and Description |
---|---|
<T> T |
runAsUserInTenant(UserId userId,
TenantId tenantId,
Callable<T> action)
Runs the given action in the context of the specified user sand tenant.
|
void |
runAsUserInTenant(UserId userId,
TenantId 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(UserId userId, TenantId tenantId, Runnable action)
CurrentIdentityService
runAsUserInTenant
in interface CurrentIdentityService
userId
- the user id to applytenantId
- the tenant id to applyaction
- the action to executepublic <T> T runAsUserInTenant(UserId userId, TenantId tenantId, Callable<T> action)
CurrentIdentityService
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 - 2018 edorasware ag. All Rights Reserved.