fix(测试跟踪): 测试跟踪部分权限问题

--bug=1026953 --user=陈建星 【测试跟踪】项目成员用户在测试计划-编辑功能用例-关联缺陷/添加缺陷-提示无权限错误信息 https://www.tapd.cn/55049933/s/1381311
This commit is contained in:
chenjianxing 2023-06-14 13:18:03 +08:00 committed by fit2-zhao
parent c4b4770b84
commit a487bb7f8d
7 changed files with 16 additions and 11 deletions

View File

@ -37,7 +37,6 @@ public class OperatingLogController {
@PostMapping("/get/source/{goPage}/{pageSize}")
@RequiresPermissions(PermissionConstants.SYSTEM_OPERATING_LOG_READ)
public Pager<List<OperatingLogDTO>> findBySourceId(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody OperatingLogRequest request) {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, operatingLogService.findBySourceId(request));

View File

@ -92,7 +92,6 @@ public class FileMetadataController {
}
@GetMapping(value = "/get/type/all")
@RequiresPermissions("PROJECT_FILE:READ")
public List<String> getTypes() {
return fileMetadataService.getTypes();
}

View File

@ -32,7 +32,6 @@ public class CustomFieldTemplateController {
}
@GetMapping("/list/{templateId}")
@RequiresPermissions(PermissionConstants.PROJECT_TEMPLATE_READ_CUSTOM)
public List<CustomFieldDao> getCustomFieldByTemplateId(@PathVariable String templateId) {
return customFieldTemplateService.getCustomFieldByTemplateId(templateId);
}

View File

@ -135,7 +135,7 @@
</el-col>
</el-row>
</el-tab-pane>
<ms-file-metadata-list ref="metadataList" @checkRows="checkRows"/>
<ms-file-metadata-list v-if="hasProjectFilePermission" ref="metadataList" @checkRows="checkRows"/>
<ms-file-batch-move ref="module" @setModuleId="setModuleId"/>
</el-tabs>
</template>
@ -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: {

View File

@ -57,6 +57,7 @@
</div>
<!-- 关联文件 -->
<div class="ref-row opt-row"
v-if="hasProjectFilePermission"
@click="associationFile"
style="
display: flex;
@ -104,7 +105,7 @@
></case-attachment-viewer>
</div>
<ms-file-metadata-list ref="metadataList" @checkRows="checkRows" />
<ms-file-metadata-list v-if="hasProjectFilePermission" ref="metadataList" @checkRows="checkRows" />
<ms-file-batch-move ref="module" @setModuleId="setModuleId" />
</div>
</template>
@ -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() {

View File

@ -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,
},

View File

@ -177,7 +177,7 @@
<issue-comment :issues-id="form.id"
@getComments="getComments"
ref="issueComment"/>
<ms-file-metadata-list ref="metadataList" @checkRows="checkRows"/>
<ms-file-metadata-list v-if="hasProjectFilePermission" ref="metadataList" @checkRows="checkRows"/>
<ms-file-batch-move ref="module" @setModuleId="setModuleId"/>
</el-form>
</el-scrollbar>
@ -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() {