Source:
<code>public Config buildConfig(Config defaultConfig, @Nullable String workspaceId) throws InfrastructureException { Subject subject = EnvironmentContext.getCurrent().getSubject(); if (oauthIdentityProvider == null) { LOG.debug("OAuth Provider is not configured, default config is used."); return defaultConfig; } <START> if (subject == Subject.ANONYMOUS) { <END> LOG.debug("OAuth Provider is not configured, default config is used."); return defaultConfig; } if (workspaceId == null) { LOG.debug( "OAuth Provider is configured and this request is not related to any workspace. OAuth token will be retrieved."); return personalizeConfig(defaultConfig); } Optional<RuntimeContext> context = workspaceRuntimeProvider.get().getRuntimeContext(workspaceId); if (!context.isPresent()) { LOG.debug( "Runtime Content for the specified workspace '%s' is not found. OAuth token will be retrieved."); return personalizeConfig(defaultConfig); } String workspaceOwnerId = context.map(c -> c.getIdentity().getOwnerId()).orElse(null); boolean isRuntimeOwner = subject.getUserId().equals(workspaceOwnerId); if (!isRuntimeOwner) { LOG.debug( "OAuth Provider is configured, but current subject is not runtime owner, default config is used." + "Subject user id: '{}'. Runtime owner id: '{}'", subject.getUserId(), workspaceOwnerId); return defaultConfig; } LOG.debug( "OAuth Provider is configured and current subject is runtime owner. OAuth token will be retrieved."); return personalizeConfig(defaultConfig); }</code><technical_language>This check combined (if (oauthIdentityProvider == null || subject == Subject.ANONYMOUS))</technical_language>

Target:
public Config buildConfig(Config defaultConfig, @Nullable String workspaceId) throws InfrastructureException { Subject subject = EnvironmentContext.getCurrent().getSubject(); if (oauthIdentityProvider == null) { LOG.debug("OAuth Provider is not configured, default config is used."); return defaultConfig; } if (subject == Subject.ANONYMOUS) { LOG.debug( "OAuth Provider is configured but default subject is anonymous, default config is used."); return defaultConfig; } if (workspaceId == null) { LOG.debug( "OAuth Provider is configured and this request is not related to any workspace. OAuth token will be retrieved."); return personalizeConfig(defaultConfig); } Optional<RuntimeContext> context = workspaceRuntimeProvider.get().getRuntimeContext(workspaceId); if (!context.isPresent()) { LOG.debug( "There is no runtime context for the specified workspace '%s'. It's the first workspace " + "related call, so context is personalized with OAuth token."); return personalizeConfig(defaultConfig); } String workspaceOwnerId = context.map(c -> c.getIdentity().getOwnerId()).orElse(null); boolean isRuntimeOwner = subject.getUserId().equals(workspaceOwnerId); if (!isRuntimeOwner) { LOG.debug( "OAuth Provider is configured, but current subject is not runtime owner, default config is used." + "Subject user id: '{}'. Runtime owner id: '{}'", subject.getUserId(), workspaceOwnerId); return defaultConfig; } LOG.debug( "OAuth Provider is configured and current subject is runtime owner. OAuth token will be retrieved."); return personalizeConfig(defaultConfig); }