private void checkTenantMatch(TenantId tenantId, UserId userId) { User user = userRepository.findOne(userId.getId()); if (!user.getTenant().getId().equals(tenantId.getId())) { throw new WrongTenantException(tenantId, userId); } } }
private void checkTenantMatch(TenantId tenantId, UserId userId) { User user = userRepository.findOne(userId.getId()); if (!user.getTenant().getId().equals(tenantId.getId())) { throw new WrongTenantException(tenantId, userId); } } }