From f183e1041c4cc840a85dc1f400e4889ae916b76c Mon Sep 17 00:00:00 2001 From: lepdou Date: Sat, 7 May 2022 20:12:36 +0800 Subject: [PATCH] Misc changes (#4343) --- .../portal/controller/ConfigsExportController.java | 1 + .../portal/controller/ConfigsImportController.java | 2 ++ .../src/main/resources/static/views/common/nav.html | 10 ---------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsExportController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsExportController.java index 2f497523ad9..85ccadc3e2d 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsExportController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsExportController.java @@ -111,6 +111,7 @@ public void exportItems(@PathVariable String appId, @PathVariable String env, * Export all configs in a compressed file. Just export namespace which current exists read permission. The permission * check in service. */ + @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @GetMapping("/configs/export") public void exportAll(@RequestParam(value = "envs") String envs, HttpServletRequest request, HttpServletResponse response) throws IOException { diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsImportController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsImportController.java index af3e3286492..3f8678d599c 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsImportController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsImportController.java @@ -76,6 +76,7 @@ public void importConfigFile(@PathVariable String appId, @PathVariable String en configsImportService.forceImportNamespaceFromFile(Env.valueOf(env), standardFilename, file.getInputStream()); } + @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @PostMapping(value = "/configs/import", params = "conflictAction=cover") public void importConfigByZipWithCoverConflictNamespace(@RequestParam(value = "envs") String envs, @RequestParam("file") MultipartFile file) throws IOException { @@ -90,6 +91,7 @@ public void importConfigByZipWithCoverConflictNamespace(@RequestParam(value = "e } } + @PreAuthorize(value = "@permissionValidator.isSuperAdmin()") @PostMapping(value = "/configs/import", params = "conflictAction=ignore") public void importConfigByZipWithIgnoreConflictNamespace(@RequestParam(value = "envs") String envs, @RequestParam("file") MultipartFile file) throws IOException { diff --git a/apollo-portal/src/main/resources/static/views/common/nav.html b/apollo-portal/src/main/resources/static/views/common/nav.html index 0c9e5266106..d0415f4dd5e 100644 --- a/apollo-portal/src/main/resources/static/views/common/nav.html +++ b/apollo-portal/src/main/resources/static/views/common/nav.html @@ -68,16 +68,6 @@ - - -