mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 20:51:26 +00:00
Minor: lineage settings should be readable by all users (#18529)
This commit is contained in:
parent
5660a751e3
commit
f1ebe816b0
@ -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 io.swagger.v3.oas.annotations.ExternalDocumentation;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
@ -128,7 +129,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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
@ -541,7 +542,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);
|
||||
|
||||
@ -616,6 +617,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user