Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc changes #4343

Merged
merged 2 commits into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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