Skip to content

Commit

Permalink
Misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lepdou committed May 7, 2022
1 parent 4e000c5 commit b83041f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
10 changes: 0 additions & 10 deletions apollo-portal/src/main/resources/static/views/common/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}})
Expand Down

0 comments on commit b83041f

Please sign in to comment.