diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java index afbc0957035..d156bb3461a 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/system/SystemResource.java @@ -1,6 +1,7 @@ package org.openmetadata.service.resources.system; import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty; +import static org.openmetadata.schema.settings.SettingsType.LINEAGE_SETTINGS; import freemarker.template.TemplateException; import io.swagger.v3.oas.annotations.ExternalDocumentation; @@ -127,7 +128,9 @@ public class SystemResource { @Parameter(description = "Name of the setting", schema = @Schema(type = "string")) @PathParam("name") String name) { - authorizer.authorizeAdmin(securityContext); + if (!name.equalsIgnoreCase(LINEAGE_SETTINGS.toString())) { + authorizer.authorizeAdmin(securityContext); + } return systemRepository.getConfigWithKey(name); } diff --git a/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SystemResourceTest.java b/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SystemResourceTest.java index 083e9f49c5c..90f49f0a45c 100644 --- a/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SystemResourceTest.java +++ b/openmetadata-service/src/test/java/org/openmetadata/service/resources/system/SystemResourceTest.java @@ -3,6 +3,7 @@ package org.openmetadata.service.resources.system; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.openmetadata.service.util.TestUtils.ADMIN_AUTH_HEADERS; +import static org.openmetadata.service.util.TestUtils.TEST_AUTH_HEADERS; import com.fasterxml.jackson.databind.ObjectMapper; import io.dropwizard.configuration.ConfigurationException; @@ -482,7 +483,7 @@ public class SystemResourceTest extends OpenMetadataApplicationTest { updateSystemConfig(updatedLineageSettings); // Retrieve the updated settings - Settings updatedSettings = getSystemConfig(SettingsType.LINEAGE_SETTINGS); + Settings updatedSettings = getSystemConfigAsUser(SettingsType.LINEAGE_SETTINGS); LineageSettings updatedLineageConfig = JsonUtils.convertValue(updatedSettings.getConfigValue(), LineageSettings.class); @@ -557,6 +558,12 @@ public class SystemResourceTest extends OpenMetadataApplicationTest { return TestUtils.get(target, Settings.class, ADMIN_AUTH_HEADERS); } + private static Settings getSystemConfigAsUser(SettingsType settingsType) + throws HttpResponseException { + WebTarget target = getResource(String.format("system/settings/%s", settingsType.value())); + return TestUtils.get(target, Settings.class, TEST_AUTH_HEADERS); + } + private static Settings getProfilerConfig() throws HttpResponseException { WebTarget target = getResource("system/settings/profilerConfiguration"); return TestUtils.get(target, Settings.class, ADMIN_AUTH_HEADERS);