refactor: 版本管理页面权限完善

This commit is contained in:
CaptainB 2021-12-30 16:05:52 +08:00 committed by 刘瑞斌
parent 407b2e5484
commit 0db74884e1
8 changed files with 58 additions and 8 deletions

@ -1 +1 @@
Subproject commit ddd2d05cba01793529905fb478de5df9d2f22ca0 Subproject commit 2a4de6d15fbac52852b0ae9050429c93a97f8483

View File

@ -1,3 +1,15 @@
-- permission
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES ('36c05551-5195-4cb8-98d4-737f15ffe0bb', 'project_admin', 'PROJECT_VERSION:READ+DELETE', 'PROJECT_VERSION');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES ('4783870f-c29c-4b00-9797-be618b4464a2', 'project_admin', 'PROJECT_VERSION:READ+ENABLE', 'PROJECT_VERSION');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES ('7396b1f2-2ed4-4582-bbd8-8d721dac96fa', 'project_admin', 'PROJECT_VERSION:READ+CREATE', 'PROJECT_VERSION');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES ('75a35739-832d-4edf-8bba-f19e46d9a8df', 'project_admin', 'PROJECT_VERSION:READ', 'PROJECT_VERSION');
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES ('8d0ba6b9-938c-4e94-b60f-df791b36f56c', 'project_admin', 'PROJECT_VERSION:READ+EDIT', 'PROJECT_VERSION');
-- version -- version
CREATE TABLE IF NOT EXISTS `project_version` CREATE TABLE IF NOT EXISTS `project_version`
( (
@ -47,7 +59,7 @@ ALTER TABLE api_definition_exec_result
ADD version_id VARCHAR(50) NULL; ADD version_id VARCHAR(50) NULL;
CREATE INDEX api_definition_exec_result_version_id_index CREATE INDEX api_definition_exec_result_version_id_index
ON api_definition_exec_result(version_id); ON api_definition_exec_result (version_id);
CREATE INDEX api_definition_ref_id_index CREATE INDEX api_definition_ref_id_index
ON api_definition (ref_id); ON api_definition (ref_id);
@ -76,11 +88,11 @@ SET version_id = project_version.id;
UPDATE api_definition_exec_result UPDATE api_definition_exec_result
JOIN api_test_case ON resource_id = api_test_case.id JOIN api_test_case ON resource_id = api_test_case.id
set api_definition_exec_result.version_id = api_test_case.version_id; SET api_definition_exec_result.version_id = api_test_case.version_id;
UPDATE api_definition_exec_result UPDATE api_definition_exec_result
JOIN api_definition ON resource_id = api_definition.id JOIN api_definition ON resource_id = api_definition.id
set api_definition_exec_result.version_id = api_definition.version_id; SET api_definition_exec_result.version_id = api_definition.version_id;
-- load_test -- load_test
ALTER TABLE load_test ALTER TABLE load_test
@ -93,7 +105,7 @@ ALTER TABLE load_test_report
ADD version_id VARCHAR(50) NULL; ADD version_id VARCHAR(50) NULL;
CREATE INDEX load_test_report_version_id_index CREATE INDEX load_test_report_version_id_index
ON load_test_report(version_id); ON load_test_report (version_id);
CREATE INDEX load_test_ref_id_index CREATE INDEX load_test_ref_id_index
ON load_test (ref_id); ON load_test (ref_id);
@ -123,7 +135,7 @@ ALTER TABLE api_scenario_report
ADD version_id VARCHAR(50) NULL; ADD version_id VARCHAR(50) NULL;
CREATE INDEX api_scenario_report_version_id_index CREATE INDEX api_scenario_report_version_id_index
ON api_scenario_report(version_id); ON api_scenario_report (version_id);
CREATE INDEX api_scenario_ref_id_index CREATE INDEX api_scenario_ref_id_index
ON api_scenario (ref_id); ON api_scenario (ref_id);

View File

@ -889,6 +889,36 @@
"name": "permission.project_enterprise_report.edit", "name": "permission.project_enterprise_report.edit",
"resourceId": "PROJECT_ENTERPRISE_REPORT", "resourceId": "PROJECT_ENTERPRISE_REPORT",
"license": true "license": true
},
{
"id": "PROJECT_VERSION:READ",
"name": "project.version.read",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+CREATE",
"name": "project.version.create_version",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+EDIT",
"name": "project.version.edit_version",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+DELETE",
"name": "project.version.delete_version",
"resourceId": "PROJECT_VERSION",
"license": true
},
{
"id": "PROJECT_VERSION:READ+ENABLE",
"name": "project.version.enable",
"resourceId": "PROJECT_VERSION",
"license": true
} }
], ],
"resource": [ "resource": [
@ -980,6 +1010,11 @@
"id": "PROJECT_FILE", "id": "PROJECT_FILE",
"name": "permission.project_file.name" "name": "permission.project_file.name"
}, },
{
"id": "PROJECT_VERSION",
"name": "project.version_manage",
"license": true
},
{ {
"id": "PROJECT_APP_MANAGER", "id": "PROJECT_APP_MANAGER",
"name": "permission.project_app_manager.name" "name": "permission.project_app_manager.name"

View File

@ -30,7 +30,7 @@
<el-menu-item :index="'/project/log'" popper-class="submenu" v-permission="['PROJECT_OPERATING_LOG:READ']"> <el-menu-item :index="'/project/log'" popper-class="submenu" v-permission="['PROJECT_OPERATING_LOG:READ']">
{{ $t('project.log') }} {{ $t('project.log') }}
</el-menu-item> </el-menu-item>
<el-menu-item v-xpack :index="'/project/version'"> <el-menu-item v-xpack :index="'/project/version'" v-permission="['PROJECT_VERSION:READ']">
{{ $t('project.version_manage') }} {{ $t('project.version_manage') }}
</el-menu-item> </el-menu-item>
<el-menu-item :index="'/project/app'" popper-class="submenu" <el-menu-item :index="'/project/app'" popper-class="submenu"

@ -1 +1 @@
Subproject commit fb9434eb68eae43e062af2ad4a4459cc716ae8ac Subproject commit 200d629717329507a32472a37aa6106372591911

View File

@ -756,6 +756,7 @@ export default {
scenario_custom_id_info: 'The scenario use case ID defaults to the system self-incremented ID', scenario_custom_id_info: 'The scenario use case ID defaults to the system self-incremented ID',
version: { version: {
name: 'Version', name: 'Version',
read: 'Search',
create_version: 'Create version', create_version: 'Create version',
edit_version: 'Edit version', edit_version: 'Edit version',
version_closed: 'Closed', version_closed: 'Closed',

View File

@ -760,6 +760,7 @@ export default {
scenario_custom_id_info: '场景用例ID默认为系统自增ID', scenario_custom_id_info: '场景用例ID默认为系统自增ID',
version: { version: {
name: '版本', name: '版本',
read: '查看',
create_version: '创建版本', create_version: '创建版本',
edit_version: '编辑版本', edit_version: '编辑版本',
version_closed: '已关闭', version_closed: '已关闭',

View File

@ -760,6 +760,7 @@ export default {
scenario_custom_id_info: '場景用例ID默認為系統自增ID', scenario_custom_id_info: '場景用例ID默認為系統自增ID',
version: { version: {
name: '版本', name: '版本',
read: '查看',
create_version: '創建版本', create_version: '創建版本',
edit_version: '編輯版本', edit_version: '編輯版本',
version_closed: '已關閉', version_closed: '已關閉',