fix: 权限问题

This commit is contained in:
chenjianxing 2021-05-27 11:04:34 +08:00 committed by BugKing
parent be1ef89069
commit 7b4dfb0725
8 changed files with 21 additions and 18 deletions

View File

@ -249,7 +249,7 @@ export default {
{ {
name: this.$t('api_test.definition.request.batch_move'), name: this.$t('api_test.definition.request.batch_move'),
handleClick: this.handleBatchMove, handleClick: this.handleBatchMove,
permissions: ['PROJECT_API_DEFINITION:READ+BATCH_MOVE'] permissions: ['PROJECT_API_DEFINITION:READ+EDIT_API']
} }
], ],
trashButtons: [ trashButtons: [

View File

@ -40,10 +40,10 @@
} }
}, },
isDisable(item) { isDisable(item) {
if (item.permission && item.permission.length > 0) { if (item.permissions && item.permissions.length > 0) {
return !hasPermissions(item.permission); return !hasPermissions(...item.permissions);
} }
return true; return false;
} }
} }
} }

View File

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<el-button class="add-btn" :disabled="readOnly" type="primary" size="mini" @click="appIssue">{{ $t('test_track.issue.add_issue') }}</el-button> <el-button class="add-btn" v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" :disabled="readOnly" type="primary" size="mini" @click="appIssue">{{ $t('test_track.issue.add_issue') }}</el-button>
<el-button class="add-btn" :disabled="readOnly" type="primary" size="mini" @click="relateIssue">{{ $t('test_track.case.relate_issue') }}</el-button> <el-button class="add-btn" v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" :disabled="readOnly" type="primary" size="mini" @click="relateIssue">{{ $t('test_track.case.relate_issue') }}</el-button>
<el-tooltip class="item" effect="dark" <el-tooltip class="item" v-permission="['PROJECT_TRACK_PLAN:READ+RELEVANCE_OR_CANCEL']" effect="dark"
:content="$t('test_track.issue.platform_tip')" :content="$t('test_track.issue.platform_tip')"
placement="right"> placement="right">
<i class="el-icon-info"/> <i class="el-icon-info"/>

View File

@ -276,7 +276,8 @@ export default {
permissions: ['PROJECT_TRACK_CASE:READ+EDIT'] permissions: ['PROJECT_TRACK_CASE:READ+EDIT']
}, { }, {
name: this.$t('test_track.case.batch_move_case'), name: this.$t('test_track.case.batch_move_case'),
handleClick: this.handleBatchMove handleClick: this.handleBatchMove,
permissions: ['PROJECT_TRACK_CASE:READ+EDIT']
}, { }, {
name: this.$t('test_track.case.batch_delete_case'), name: this.$t('test_track.case.batch_delete_case'),
handleClick: this.handleDeleteBatch, handleClick: this.handleDeleteBatch,

View File

@ -230,9 +230,9 @@ export default {
deletePath: "/test/case/delete", deletePath: "/test/case/delete",
selectRows: new Set(), selectRows: new Set(),
buttons: [ buttons: [
{name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']}, {name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']},
{name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']}, {name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']},
{name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']} {name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']}
], ],
typeArr: [ typeArr: [
{id: 'projectEnv', name: this.$t('api_test.definition.request.run_env')}, {id: 'projectEnv', name: this.$t('api_test.definition.request.run_env')},

View File

@ -205,13 +205,13 @@ export default {
...API_SCENARIO_FILTERS, ...API_SCENARIO_FILTERS,
buttons: [ buttons: [
{ {
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
}, },
{ {
name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'] name: this.$t('api_test.automation.batch_execute'), handleClick: this.handleBatchExecute, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']
}, },
{ {
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT'] name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']
} }
], ],
selectRows: new Set(), selectRows: new Set(),

View File

@ -360,10 +360,12 @@ export default {
showMore: false, showMore: false,
buttons: [ buttons: [
{ {
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT'] name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT']
}, },
{ {
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch,
permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
} }
], ],
typeArr: [ typeArr: [

View File

@ -199,10 +199,10 @@ export default {
screenHeight: 'calc(100vh - 330px)',// screenHeight: 'calc(100vh - 330px)',//
buttons: [ buttons: [
{ {
name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'] name: this.$t('test_track.plan.load_case.unlink_in_bulk'), handleClick: this.handleDeleteBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE']
}, },
{ {
name: this.$t('test_track.plan.load_case.batch_exec_cases'), handleClick: this.handleRunBatch, permission: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'] name: this.$t('test_track.plan.load_case.batch_exec_cases'), handleClick: this.handleRunBatch, permissions: ['PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN']
} }
], ],
statusFilters: [ statusFilters: [