diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java index f4028b241a6c..589b7870183d 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java @@ -68,7 +68,6 @@ import org.openmetadata.service.security.Authorizer; import org.openmetadata.service.security.policyevaluator.CompiledRule; import org.openmetadata.service.security.policyevaluator.RuleEvaluator; -import org.openmetadata.service.util.JsonUtils; import org.openmetadata.service.util.ResultList; @Slf4j @@ -107,23 +106,6 @@ public void initialize(OpenMetadataApplicationConfig config) throws IOException repository.initSeedDataFromResources(); } - @Override - public void upgrade() throws IOException { - // Introduced in 0.13 - // OrganizationPolicy rule change - Policy originalOrgPolicy = repository.getByName(null, Entity.ORGANIZATION_POLICY_NAME, repository.getPatchFields()); - Policy updatedOrgPolicy = JsonUtils.readValue(JsonUtils.pojoToJson(originalOrgPolicy), Policy.class); - - // Rules are in alphabetical order - change second rule "OrganizationPolicy-Owner-Rule" - // from ALL operation to remove CREATE operation and allow all the other operations for the owner - updatedOrgPolicy - .getRules() - .get(1) - .withOperations(List.of(MetadataOperation.EDIT_ALL, MetadataOperation.VIEW_ALL, MetadataOperation.DELETE)); - repository.patch( - null, originalOrgPolicy.getId(), "admin", JsonUtils.getJsonPatch(originalOrgPolicy, updatedOrgPolicy)); - } - public static class PolicyList extends ResultList { /* Required for serde */ }