fix(测试用例): 操作权限问题#1003873

This commit is contained in:
shiziyuan9527 2021-07-13 14:15:13 +08:00 committed by 刘瑞斌
parent 2accb03dd0
commit 7fe6ca8dc6
3 changed files with 7 additions and 1 deletions

View File

@ -331,6 +331,8 @@ export default {
return; return;
} }
} }
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
this.$set(testCase, 'rowClickHasPermission', hasEditPermission);
this.addTab({name: 'edit', testCaseInfo: testCase}); this.addTab({name: 'edit', testCaseInfo: testCase});
}, },
handleCaseCreateOrEdit(data, type) { handleCaseCreateOrEdit(data, type) {

View File

@ -282,6 +282,10 @@
return SYSTEM_FIELD_NAME_MAP; return SYSTEM_FIELD_NAME_MAP;
}, },
readOnly() { readOnly() {
const {rowClickHasPermission} = this.currentTestCaseInfo;
if (rowClickHasPermission !== undefined) {
return !rowClickHasPermission;
}
return !hasPermission('PROJECT_TRACK_CASE:READ+CREATE') && return !hasPermission('PROJECT_TRACK_CASE:READ+CREATE') &&
!hasPermission('PROJECT_TRACK_CASE:READ+EDIT'); !hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
} }

View File

@ -310,7 +310,7 @@ export default {
{ {
tip: this.$t('commons.copy'), icon: "el-icon-copy-document", type: "success", tip: this.$t('commons.copy'), icon: "el-icon-copy-document", type: "success",
exec: this.handleCopy, exec: this.handleCopy,
permissions: ['PROJECT_TRACK_CASE:READ+EDIT'] permissions: ['PROJECT_TRACK_CASE:READ+COPY']
}, },
{ {
tip: this.$t('commons.delete'), icon: "el-icon-delete", type: "danger", tip: this.$t('commons.delete'), icon: "el-icon-delete", type: "danger",