From c8be0606e0a8ecb6ce96166aef3fdbab0b9a6b2c Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 21 Oct 2024 16:03:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=88=86=E4=BA=AB=E6=8E=A5=E5=8F=A3=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk/constants/PermissionConstants.java | 1 + .../definition/ApiDocShareController.java | 8 ++++---- .../api-test/src/main/resources/permission.json | 13 ------------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java index 342c872f6a..680b2fb9c1 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/constants/PermissionConstants.java @@ -264,6 +264,7 @@ public class PermissionConstants { public static final String PROJECT_API_DEFINITION_IMPORT = "PROJECT_API_DEFINITION:READ+IMPORT"; public static final String PROJECT_API_DEFINITION_EXPORT = "PROJECT_API_DEFINITION:READ+EXPORT"; public static final String PROJECT_API_DEFINITION_EXECUTE = "PROJECT_API_DEFINITION:READ+EXECUTE"; + public static final String PROJECT_API_DEFINITION_SHARE = "PROJECT_API_DEFINITION:READ+SHARE"; public static final String PROJECT_API_DEFINITION_CASE_READ = "PROJECT_API_DEFINITION_CASE:READ"; public static final String PROJECT_API_DEFINITION_CASE_ADD = "PROJECT_API_DEFINITION_CASE:READ+ADD"; public static final String PROJECT_API_DEFINITION_CASE_UPDATE = "PROJECT_API_DEFINITION_CASE:READ+UPDATE"; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java index a0d899fd34..11af07de4b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/controller/definition/ApiDocShareController.java @@ -48,7 +48,7 @@ public class ApiDocShareController { @PostMapping(value = "/page") @Operation(summary = "接口测试-定义-分页获取分享列表") - @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE) + @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE) @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Pager> page(@Validated @RequestBody ApiDocSharePageRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), @@ -58,7 +58,7 @@ public class ApiDocShareController { @PostMapping(value = "/add") @Operation(summary = "接口测试-定义-新增分享") - @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE) + @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE) @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") @Log(type = OperationLogType.ADD, expression = "#msClass.addLog(#request)", msClass = ApiDocShareLogService.class) public ApiDocShare add(@Validated({Created.class}) @RequestBody ApiDocShareEditRequest request) { @@ -67,7 +67,7 @@ public class ApiDocShareController { @PostMapping(value = "/update") @Operation(summary = "接口测试-定义-更新分享") - @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE) + @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE) @CheckOwner(resourceId = "#request.getId()", resourceType = "api_doc_share") @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = ApiDocShareLogService.class) public ApiDocShare update(@Validated({Updated.class}) @RequestBody ApiDocShareEditRequest request) { @@ -77,7 +77,7 @@ public class ApiDocShareController { @GetMapping("/delete/{id}") @Operation(summary = "接口测试-定义-删除分享") @Parameter(name = "id", description = "分享ID", schema = @Schema(requiredMode = Schema.RequiredMode.REQUIRED)) - @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_DOC_SHARE) + @RequiresPermissions(PermissionConstants.PROJECT_API_DEFINITION_SHARE) @CheckOwner(resourceId = "#id", resourceType = "api_doc_share") @Log(type = OperationLogType.DELETE, expression = "#msClass.deleteLog(#id)", msClass = ApiDocShareLogService.class) public void delete(@PathVariable String id) { diff --git a/backend/services/api-test/src/main/resources/permission.json b/backend/services/api-test/src/main/resources/permission.json index 8efc32e5a9..373159d418 100644 --- a/backend/services/api-test/src/main/resources/permission.json +++ b/backend/services/api-test/src/main/resources/permission.json @@ -97,19 +97,6 @@ } ] }, - { - "id": "PROJECT_API_DEFINITION_DOC", - "name": "permission.api_doc.name", - "permissions": [ - { - "id": "PROJECT_API_DEFINITION_DOC:READ" - }, - { - "id": "PROJECT_API_DEFINITION_DOC:READ+SHARE", - "name": "permission.api_doc.share" - } - ] - }, { "id": "PROJECT_API_SCENARIO", "name": "message.api_scenario_task",