WithUser refactoring (#2944)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -169,11 +169,11 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
|
||||
SecurityContextHolder.setContext(securityContextImpl);
|
||||
}
|
||||
|
||||
private static void setTenantSecurityContext(final String tenantId) {
|
||||
private static void setTenantSecurityContext(final String tenant) {
|
||||
final AnonymousAuthenticationToken authenticationToken = new AnonymousAuthenticationToken(
|
||||
UUID.randomUUID().toString(), "AMQP-Controller",
|
||||
List.of(new SimpleGrantedAuthority(SpRole.CONTROLLER_ROLE_ANONYMOUS)));
|
||||
authenticationToken.setDetails(new TenantAwareAuthenticationDetails(tenantId, true));
|
||||
authenticationToken.setDetails(new TenantAwareAuthenticationDetails(tenant, true));
|
||||
setSecurityContext(authenticationToken);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user