lepdou 2 vuotta sitten
vanhempi
commit
f183e1041c

+ 1 - 0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsExportController.java

@@ -111,6 +111,7 @@ public class ConfigsExportController {
    * 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 {

+ 2 - 0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigsImportController.java

@@ -76,6 +76,7 @@ public class ConfigsImportController {
     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 class ConfigsImportController {
     }
   }
 
+  @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 {

+ 0 - 10
apollo-portal/src/main/resources/static/views/common/nav.html

@@ -68,16 +68,6 @@
                     </ul>
                 </li>
 
-                <!-- normal user tool (not admin)-->
-                <li class="dropdown" ng-if="hasRootPermission == false">
-                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
-                        <span class="glyphicon glyphicon-cog"></span>&nbsp;{{'Common.Nav.NonAdminTools' | translate }}
-                        <span class="caret"></span></a>
-                    <ul class="dropdown-menu" >
-                        <li><a href="{{ '/config_export.html' | prefixPath }}" target="_blank">{{'Common.Nav.ConfigExport' | translate }}</a></li>
-                    </ul>
-                </li>
-
                 <li class="dropdown">
                     <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                         <span class="glyphicon glyphicon-user"></span>&nbsp;{{userDisplayName}}({{userName}})