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",