From a487bb7f8d6d2d9901e2c114c7d7f2961f14e86a Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 14 Jun 2023 13:18:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=E9=83=A8=E5=88=86=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1026953 --user=陈建星 【测试跟踪】项目成员用户在测试计划-编辑功能用例-关联缺陷/添加缺陷-提示无权限错误信息 https://www.tapd.cn/55049933/s/1381311 --- .../log/controller/OperatingLogController.java | 1 - .../metadata/controller/FileMetadataController.java | 1 - .../controller/CustomFieldTemplateController.java | 1 - .../business/case/components/TestCaseEditOtherInfo.vue | 7 +++++-- .../case/components/case/CaseAttachmentComponent.vue | 8 ++++++-- .../business/case/components/case/CaseIssueEditDetail.vue | 2 -- .../frontend/src/business/issue/IssueEditDetail.vue | 7 +++++-- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/controller/OperatingLogController.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/controller/OperatingLogController.java index f42e190a8c..39e6fa1209 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/controller/OperatingLogController.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/log/controller/OperatingLogController.java @@ -37,7 +37,6 @@ public class OperatingLogController { @PostMapping("/get/source/{goPage}/{pageSize}") - @RequiresPermissions(PermissionConstants.SYSTEM_OPERATING_LOG_READ) public Pager> findBySourceId(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody OperatingLogRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, operatingLogService.findBySourceId(request)); diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/controller/FileMetadataController.java b/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/controller/FileMetadataController.java index 0b23bc8af6..70a2f3ce43 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/controller/FileMetadataController.java +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/metadata/controller/FileMetadataController.java @@ -92,7 +92,6 @@ public class FileMetadataController { } @GetMapping(value = "/get/type/all") - @RequiresPermissions("PROJECT_FILE:READ") public List getTypes() { return fileMetadataService.getTypes(); } diff --git a/project-management/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java b/project-management/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java index 512a6f3e63..3bf307f318 100644 --- a/project-management/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java +++ b/project-management/backend/src/main/java/io/metersphere/controller/CustomFieldTemplateController.java @@ -32,7 +32,6 @@ public class CustomFieldTemplateController { } @GetMapping("/list/{templateId}") - @RequiresPermissions(PermissionConstants.PROJECT_TEMPLATE_READ_CUSTOM) public List getCustomFieldByTemplateId(@PathVariable String templateId) { return customFieldTemplateService.getCustomFieldByTemplateId(templateId); } diff --git a/test-track/frontend/src/business/case/components/TestCaseEditOtherInfo.vue b/test-track/frontend/src/business/case/components/TestCaseEditOtherInfo.vue index 98172d26a4..5cd9d4d350 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEditOtherInfo.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEditOtherInfo.vue @@ -135,7 +135,7 @@ - + @@ -164,7 +164,7 @@ import {getCurrentProjectID} from "metersphere-frontend/src/utils/token" import {issueDemandList} from "@/api/issue"; import {TokenKey} from "metersphere-frontend/src/utils/constants"; import DependenciesList from "@/business/common/DependenciesList"; -import {byteToSize, getCurrentUser, getTypeByFileName} from "@/business/utils/sdk-utils"; +import {byteToSize, getCurrentUser, getTypeByFileName, hasPermission} from "@/business/utils/sdk-utils"; import axios from "axios"; import MsFileMetadataList from "metersphere-frontend/src/components/environment/commons/variable/QuoteFileList"; import MsFileBatchMove from "metersphere-frontend/src/components/environment/commons/variable/FileBatchMove"; @@ -213,6 +213,9 @@ export default { computed: { isTesterPermission() { return true; + }, + hasProjectFilePermission() { + return hasPermission("PROJECT_FILE:READ"); } }, watch: { diff --git a/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue b/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue index f5323f05cc..f93d25b4dd 100644 --- a/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue +++ b/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue @@ -57,6 +57,7 @@
+
@@ -115,7 +116,7 @@ import { TokenKey } from "metersphere-frontend/src/utils/constants"; import { byteToSize, getCurrentUser, - getTypeByFileName, + getTypeByFileName, hasPermission, } from "@/business/utils/sdk-utils"; import axios from "axios"; import { getUUID } from "metersphere-frontend/src/utils"; @@ -172,6 +173,9 @@ export default { targetId() { return this.belongType === "issue" ? this.issueId : this.caseId; }, + hasProjectFilePermission() { + return hasPermission("PROJECT_FILE:READ"); + } }, watch: { caseId() { diff --git a/test-track/frontend/src/business/case/components/case/CaseIssueEditDetail.vue b/test-track/frontend/src/business/case/components/case/CaseIssueEditDetail.vue index d4471da622..4e34b8a0da 100644 --- a/test-track/frontend/src/business/case/components/case/CaseIssueEditDetail.vue +++ b/test-track/frontend/src/business/case/components/case/CaseIssueEditDetail.vue @@ -171,7 +171,6 @@ import MsMarkDownText from "metersphere-frontend/src/components/MsMarkDownText"; import IssueComment from "@/business/issue/IssueComment"; import ReviewCommentItem from "@/business/review/commom/ReviewCommentItem"; import TestCaseAttachment from "@/business/case/components/TestCaseAttachment"; -import MsFileMetadataList from "metersphere-frontend/src/components/environment/commons/variable/QuoteFileList"; import MsFileBatchMove from "metersphere-frontend/src/components/environment/commons/variable/FileBatchMove"; export default { @@ -188,7 +187,6 @@ export default { IssueComment, ReviewCommentItem, TestCaseAttachment, - MsFileMetadataList, MsFileBatchMove, CaseAttachmentComponent, }, diff --git a/test-track/frontend/src/business/issue/IssueEditDetail.vue b/test-track/frontend/src/business/issue/IssueEditDetail.vue index 732f588f64..72e544abe8 100644 --- a/test-track/frontend/src/business/issue/IssueEditDetail.vue +++ b/test-track/frontend/src/business/issue/IssueEditDetail.vue @@ -177,7 +177,7 @@ - + @@ -200,7 +200,7 @@ import { getCurrentWorkspaceId, getCurrentUserId } from "metersphere-frontend/src/utils/token" -import {hasLicense} from "metersphere-frontend/src/utils/permission"; +import {hasLicense, hasPermission} from "metersphere-frontend/src/utils/permission"; import { enableThirdPartTemplate, getIssuePartTemplateWithProject, @@ -350,6 +350,9 @@ export default { projectId() { return getCurrentProjectID(); }, + hasProjectFilePermission() { + return hasPermission("PROJECT_FILE:READ"); + } }, watch: { tabActiveName() {