refactor(测试跟踪): 新增测试计划报告编辑的权限

--bug=1026331 --user=陈建星 [系统设置] github#24462 项目成员想修改报告名称,但修改不了,原因 修改名称的权限和删除报告权限是同一个 https://www.tapd.cn/55049933/s/1374441
This commit is contained in:
chenjianxing 2023-05-23 15:20:47 +08:00 committed by fit2-zhao
parent c0d244003b
commit 69d3e9a8e1
8 changed files with 21 additions and 3 deletions

View File

@ -2947,6 +2947,7 @@ const message = {
project_track_report: {
name: "Report",
read: "READ",
edit: "EDIT",
delete: "DELETE",
export: "EXPORT",
},

View File

@ -2852,6 +2852,7 @@ const message = {
project_track_report: {
name: "报告",
read: "查询报告",
edit: "编辑报告",
delete: "删除报告",
export: "导出报告",
},

View File

@ -2847,6 +2847,7 @@ const message = {
project_track_report: {
name: "報告",
read: "查詢報告",
edit: "編輯報告",
delete: "刪除報告",
export: "導出報告",
},

View File

@ -122,6 +122,7 @@ public class PermissionConstants {
public static final String PROJECT_TRACK_REPORT_READ = "PROJECT_TRACK_REPORT:READ";
public static final String PROJECT_TRACK_REPORT_READ_DELETE = "PROJECT_TRACK_REPORT:READ+DELETE";
public static final String PROJECT_TRACK_REPORT_READ_EDIT = "PROJECT_TRACK_REPORT:READ+EDIT";
public static final String PROJECT_TRACK_REPORT_READ_EXPORT = "PROJECT_TRACK_REPORT:READ+EXPORT";
public static final String PROJECT_API_DEFINITION_READ = "PROJECT_API_DEFINITION:READ";

View File

@ -0,0 +1,8 @@
SET SESSION innodb_lock_wait_timeout = 7200;
-- 处理兼容数据,角色原本有测试计划报告删除的权限,则添加报告编辑的权限
INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
SELECT uuid(), group_id, 'PROJECT_TRACK_REPORT:READ+EDIT', 'PROJECT_TRACK_REPORT'
FROM user_group_permission WHERE permission_id = 'PROJECT_TRACK_REPORT:READ+DELETE';
SET SESSION innodb_lock_wait_timeout = DEFAULT;

View File

@ -212,6 +212,11 @@
"name": "permission.project_track_report.read",
"resourceId": "PROJECT_TRACK_REPORT"
},
{
"id": "PROJECT_TRACK_REPORT:READ+EDIT",
"name": "permission.project_track_report.edit",
"resourceId": "PROJECT_TRACK_REPORT"
},
{
"id": "PROJECT_TRACK_REPORT:READ+DELETE",
"name": "permission.project_track_report.delete",
@ -249,4 +254,4 @@
"name": "permission.project_track_report.name"
}
]
}
}

View File

@ -26,6 +26,7 @@ import {editPlanReport} from "@/api/remote/plan/test-plan";
import TestPlanReportContainer from "@/business/plan/view/comonents/report/detail/TestPlanReportContainer";
import MsRichText from "@/business/case/components/MsRichText";
import {testPlanDbReportEdit} from "@/api/remote/plan/test-plan-report";
import {hasPermission} from "@/business/utils/sdk-utils";
export default {
name: "TestPlanSummaryReport",
components: {MsRichText, TestPlanReportContainer, MsFormDivider},
@ -44,7 +45,7 @@ export default {
},
computed: {
showEdit() {
return !this.isTemplate && !this.isShare;
return !this.isTemplate && !this.isShare && hasPermission("PROJECT_TRACK_REPORT:READ+EDIT");
}
},
methods: {

View File

@ -30,7 +30,7 @@
<ms-table-column
prop="name"
sortable="custom"
permission="PROJECT_TRACK_REPORT:READ+DELETE"
permission="PROJECT_TRACK_REPORT:READ+EDIT"
:field="item"
:fields-width="fieldsWidth"
:label="$t('test_track.report.list.name')"