diff --git a/backend/web/src/main/java/org/opencdmp/interceptors/tenant/TenantInterceptor.java b/backend/web/src/main/java/org/opencdmp/interceptors/tenant/TenantInterceptor.java index d4bd37381..3c351d99a 100644 --- a/backend/web/src/main/java/org/opencdmp/interceptors/tenant/TenantInterceptor.java +++ b/backend/web/src/main/java/org/opencdmp/interceptors/tenant/TenantInterceptor.java @@ -124,7 +124,8 @@ public class TenantInterceptor implements WebRequestInterceptor { if (cacheValue != null) { isUserAllowedTenant = cacheValue.isAllowed(); } else { - isUserAllowedTenant = this.isUserAllowedTenant(); + List tenants = this.claimExtractor.asStrings(this.currentPrincipalResolver.currentPrincipal(), ClaimNames.TenantCodesClaimName); + if (tenants.contains(this.tenantScope.getTenantCode())) isUserAllowedTenant = this.isUserAllowedTenant(); this.userAllowedTenantCacheService.put(new UserAllowedTenantCacheService.UserAllowedTenantCacheValue(this.userScope.getUserId(), this.tenantScope.getTenant(), isUserAllowedTenant)); } }