From f84fc654679741f2d4d74c1343bcbe852e39d3a1 Mon Sep 17 00:00:00 2001
From: wxg0103 <727495428@qq.com>
Date: Wed, 14 Jun 2023 19:06:08 +0800
Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E6=9D=83=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=1027038 --user=王孝刚 【接口测试】只读用户-快捷调试-可点击另存为新用例-进入创建用例页面-但是无法填名称
https://www.tapd.cn/55049933/s/1382020
--bug=1027033 --user=王孝刚
【接口测试】只读用户-接口定义-环境配置-可编辑环境
https://www.tapd.cn/55049933/s/1382022
--bug=1027012 --user=王孝刚
【接口测试】只读用户开启场景调试权限-场景详情-点击调试没反应
https://www.tapd.cn/55049933/s/1382025
--bug=1026828 --user=王孝刚
【系统设置】用户组和权限-项目管理员未开启性能测试报告的“删除权限”,导致用户不能修改性能测试的报告名称。
https://www.tapd.cn/55049933/s/1382027
---
.../automation/scenario/EditApiScenario.vue | 4 +--
.../scenario/common/ApiBaseComponent.vue | 31 +++++++++++++-----
.../scenario/component/ApiComponent.vue | 12 +++++--
.../component/ApiScenarioComponent.vue | 32 ++++++++++++-------
.../components/debug/DebugHttpPage.vue | 2 +-
.../components/runtest/RunTestHTTPPage.vue | 2 +-
.../environment/EnvironmentCommonConfig.vue | 2 +-
.../environment/EnvironmentEdit.vue | 2 +-
.../environment/EnvironmentHttpConfig.vue | 14 ++++----
.../environment/database/DatabaseConfig.vue | 2 +-
.../database/DatabaseConfigList.vue | 4 +--
11 files changed, 69 insertions(+), 38 deletions(-)
diff --git a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue
index 6f9d69b1b8..21d5bc423e 100644
--- a/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue
+++ b/api-test/frontend/src/business/automation/scenario/EditApiScenario.vue
@@ -568,7 +568,7 @@ import { KeyValue } from '@/business/definition/model/ApiTestModel';
import { getCurrentProjectID, getCurrentUser } from 'metersphere-frontend/src/utils/token';
import { getUUID, objToStrMap, strMapToObj } from 'metersphere-frontend/src/utils';
-import { hasLicense, hasPermission } from 'metersphere-frontend/src/utils/permission';
+import { hasLicense, hasPermissions } from 'metersphere-frontend/src/utils/permission';
import OutsideClick from './common/outside-click';
import {
getReportMessageSocket,
@@ -1723,7 +1723,7 @@ export default {
});
},
runDebug(runScenario) {
- if (!hasPermission('PROJECT_API_SCENARIO:READ+EDIT')) {
+ if (!hasPermissions('PROJECT_API_SCENARIO:READ+DEBUG','PROJECT_API_SCENARIO:READ+RUN')) {
return;
}
this.mergeScenario(this.scenarioDefinition);
diff --git a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue
index be28ba5bb1..b815c9bec6 100644
--- a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue
+++ b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue
@@ -65,18 +65,18 @@
diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue
index 35160905bc..22a5529e72 100644
--- a/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue
+++ b/api-test/frontend/src/business/automation/scenario/component/ApiComponent.vue
@@ -90,7 +90,11 @@
icon="el-icon-video-play"
class="ms-btn"
size="mini"
- circle />
+ circle
+ v-permission="[
+ 'PROJECT_API_SCENARIO:READ+DEBUG',
+ 'PROJECT_API_SCENARIO:READ+RUN'
+ ]"/>
+ circle
+ v-permission="[
+ 'PROJECT_API_SCENARIO:READ+DEBUG',
+ 'PROJECT_API_SCENARIO:READ+RUN'
+ ]">
STOP
diff --git a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue
index 7a20276d4c..5db364911f 100644
--- a/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue
+++ b/api-test/frontend/src/business/automation/scenario/component/ApiScenarioComponent.vue
@@ -29,7 +29,7 @@
-
+
{{ $t('project.version.name') }}: {{ scenario.versionName }}
@@ -39,9 +39,9 @@
{{ $t('api_test.automation.reference_deleted') }}
- {{ $t('commons.copy') }}
+ {{ $t('commons.copy') }}
{{ $t('api_test.scenario.reference') }}
+ >{{ $t('api_test.scenario.reference') }}
{{ getProjectName(scenario.projectId) }}
-
+
-
+
{{ $t('commons.testing') }}
+ circle
+ v-permission="[
+ 'PROJECT_API_SCENARIO:READ+DEBUG',
+ 'PROJECT_API_SCENARIO:READ+RUN'
+ ]"/>
+ circle
+ v-permission="[
+ 'PROJECT_API_SCENARIO:READ+DEBUG',
+ 'PROJECT_API_SCENARIO:READ+RUN'
+ ]">
STOP
@@ -109,11 +117,11 @@ import MsTcpBasisParameters from '../../../definition/components/request/tcp/Tcp
import MsDubboBasisParameters from '../../../definition/components/request/dubbo/BasisParameters';
import MsApiRequestForm from '../../../definition/components/request/http/ApiHttpRequestForm';
import ApiBaseComponent from '../common/ApiBaseComponent';
-import { getCurrentProjectID, getCurrentWorkspaceId } from 'metersphere-frontend/src/utils/token';
-import { getUUID, strMapToObj } from 'metersphere-frontend/src/utils';
-import { STEP } from '@/business/automation/scenario/Setting';
-import { getOwnerProjectIds, getProject } from '@/api/project';
-import { checkScenarioEnv, getScenarioById, setScenarioDomain } from '@/api/scenario';
+import {getCurrentProjectID, getCurrentWorkspaceId} from 'metersphere-frontend/src/utils/token';
+import {getUUID, strMapToObj} from 'metersphere-frontend/src/utils';
+import {STEP} from '@/business/automation/scenario/Setting';
+import {getOwnerProjectIds, getProject} from '@/api/project';
+import {checkScenarioEnv, getScenarioById, setScenarioDomain} from '@/api/scenario';
export default {
name: 'ApiScenarioComponent',
diff --git a/api-test/frontend/src/business/definition/components/debug/DebugHttpPage.vue b/api-test/frontend/src/business/definition/components/debug/DebugHttpPage.vue
index f0f3443125..bfbfb618dd 100644
--- a/api-test/frontend/src/business/definition/components/debug/DebugHttpPage.vue
+++ b/api-test/frontend/src/business/definition/components/debug/DebugHttpPage.vue
@@ -33,7 +33,7 @@
v-if="testCase === undefined && !scenario">
{{ $t('commons.test') }}
- {{ $t('api_test.definition.request.save_as_case') }}
diff --git a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue
index 81ea505216..a3f0a0ef37 100644
--- a/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue
+++ b/api-test/frontend/src/business/definition/components/runtest/RunTestHTTPPage.vue
@@ -35,7 +35,7 @@
@command="handleCommand"
size="small"
v-if="!runLoading"
- v-permission="['PROJECT_API_DEFINITION:READ+EDIT_API']">
+ v-permission="['PROJECT_API_DEFINITION:READ+EDIT_API', 'PROJECT_API_DEFINITION:READ+CREATE_CASE']">
{{ $t('commons.test') }}
-
+
diff --git a/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue b/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue
index 3203f3274f..eb97f4f755 100644
--- a/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue
+++ b/framework/sdk-parent/frontend/src/components/environment/EnvironmentEdit.vue
@@ -22,7 +22,7 @@
-
+
{{ $t('commons.confirm') }}
diff --git a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue
index 0bbc7f5c9b..edc6889333 100644
--- a/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue
+++ b/framework/sdk-parent/frontend/src/components/environment/EnvironmentHttpConfig.vue
@@ -49,23 +49,23 @@
{{ $t('api_test.request.headers') }}
- {{
+ {{
$t("commons.batch_add")
}}
-
+
-
+
{{ $t('commons.add') }}
-
+
{{ $t('commons.clear') }}
- {{
+ {{
$t('commons.update')
}}
@@ -105,9 +105,9 @@
+ icon="el-icon-document-copy" @exec="copy(row)" :disabled="isReadOnly"/>
+ icon="el-icon-delete" @exec="remove(row)" type="danger" :disabled="isReadOnly"/>
diff --git a/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfig.vue b/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfig.vue
index 92bfc5b26a..17abcc1652 100644
--- a/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfig.vue
+++ b/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfig.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfigList.vue b/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfigList.vue
index c82724fd52..0001cd3968 100644
--- a/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfigList.vue
+++ b/framework/sdk-parent/frontend/src/components/environment/database/DatabaseConfigList.vue
@@ -17,9 +17,9 @@
+ @exec="handleCopy(scope.$index, scope.row)" :disabled="isReadOnly"/>
+ @exec="handleDelete(scope.$index)" :disabled="isReadOnly"/>