WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit f183e10

Browse files
authored
Misc changes (#4343)
1 parent 74225fd commit f183e10

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public void exportItems(@PathVariable String appId, @PathVariable String env,
111111
* Export all configs in a compressed file. Just export namespace which current exists read permission. The permission
112112
* check in service.
113113
*/
114+
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()")
114115
@GetMapping("/configs/export")
115116
public void exportAll(@RequestParam(value = "envs") String envs,
116117
HttpServletRequest request, HttpServletResponse response) throws IOException {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public void importConfigFile(@PathVariable String appId, @PathVariable String en
7676
configsImportService.forceImportNamespaceFromFile(Env.valueOf(env), standardFilename, file.getInputStream());
7777
}
7878

79+
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()")
7980
@PostMapping(value = "/configs/import", params = "conflictAction=cover")
8081
public void importConfigByZipWithCoverConflictNamespace(@RequestParam(value = "envs") String envs,
8182
@RequestParam("file") MultipartFile file) throws IOException {
@@ -90,6 +91,7 @@ public void importConfigByZipWithCoverConflictNamespace(@RequestParam(value = "e
9091
}
9192
}
9293

94+
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()")
9395
@PostMapping(value = "/configs/import", params = "conflictAction=ignore")
9496
public void importConfigByZipWithIgnoreConflictNamespace(@RequestParam(value = "envs") String envs,
9597
@RequestParam("file") MultipartFile file) throws IOException {

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@
6868
</ul>
6969
</li>
7070

71-
<!-- normal user tool (not admin)-->
72-
<li class="dropdown" ng-if="hasRootPermission == false">
73-
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
74-
<span class="glyphicon glyphicon-cog"></span>&nbsp;{{'Common.Nav.NonAdminTools' | translate }}
75-
<span class="caret"></span></a>
76-
<ul class="dropdown-menu" >
77-
<li><a href="{{ '/config_export.html' | prefixPath }}" target="_blank">{{'Common.Nav.ConfigExport' | translate }}</a></li>
78-
</ul>
79-
</li>
80-
8171
<li class="dropdown">
8272
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
8373
<span class="glyphicon glyphicon-user"></span>&nbsp;{{userDisplayName}}({{userName}})

0 commit comments

Comments
 (0)