Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MeterSphere
Commits
a33111de
Commit
a33111de
authored
3 years ago
by
shiziyuan9527
Browse files
Options
Download
Email Patches
Plain Diff
refactor(测试计划): 批量权限设置
parent
e074c50b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
backend/src/main/resources/db/migration/V85__v1.10_permission_refactor.sql
+13
-0
...resources/db/migration/V85__v1.10_permission_refactor.sql
backend/src/main/resources/permission.json
+15
-0
backend/src/main/resources/permission.json
frontend/src/business/components/track/case/components/ShowMoreBtn.vue
+1
-1
...business/components/track/case/components/ShowMoreBtn.vue
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue
+3
-3
...nts/track/plan/view/comonents/api/TestPlanApiCaseList.vue
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue
+5
-3
...track/plan/view/comonents/api/TestPlanApiScenarioList.vue
frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue
+2
-2
...plan/view/comonents/functional/FunctionalTestCaseList.vue
frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue
+2
-2
...s/track/plan/view/comonents/load/TestPlanLoadCaseList.vue
with
41 additions
and
11 deletions
+41
-11
backend/src/main/resources/db/migration/V85__v1.10_permission_refactor.sql
+
13
-
0
View file @
a33111de
...
...
@@ -406,6 +406,13 @@ INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES
(
uuid
(),
'project_admin'
,
'PROJECT_ENVIRONMENT:READ'
,
'PROJECT_ENVIRONMENT'
);
INSERT
INTO
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
VALUES
(
uuid
(),
'project_admin'
,
'PROJECT_TRACK_CASE:READ+COPY'
,
'PROJECT_TRACK_CASE'
);
insert
into
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
values
(
uuid
(),
'project_admin'
,
'PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT'
,
'PROJECT_TRACK_PLAN'
);
insert
into
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
values
(
uuid
(),
'project_admin'
,
'PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'
,
'PROJECT_TRACK_PLAN'
);
insert
into
metersphere_dev
.
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
values
(
uuid
(),
'project_admin'
,
'PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'
,
'PROJECT_TRACK_PLAN'
);
-- 项目成员
INSERT
INTO
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
...
...
@@ -540,6 +547,12 @@ INSERT INTO user_group_permission (id, group_id, permission_id, module_id)
VALUES
(
uuid
(),
'project_member'
,
'PROJECT_API_SCENARIO:READ+RUN'
,
'PROJECT_API_SCENARIO'
);
INSERT
INTO
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
VALUES
(
uuid
(),
'project_member'
,
'PROJECT_TRACK_PLAN:READ'
,
'PROJECT_TRACK_PLAN'
);
insert
into
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
values
(
uuid
(),
'project_member'
,
'PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT'
,
'PROJECT_TRACK_PLAN'
);
insert
into
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
values
(
uuid
(),
'project_member'
,
'PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN'
,
'PROJECT_TRACK_PLAN'
);
insert
into
metersphere_dev
.
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
values
(
uuid
(),
'project_member'
,
'PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE'
,
'PROJECT_TRACK_PLAN'
);
-- 只读用户
INSERT
INTO
user_group_permission
(
id
,
group_id
,
permission_id
,
module_id
)
...
...
This diff is collapsed.
Click to expand it.
backend/src/main/resources/permission.json
+
15
-
0
View file @
a33111de
...
...
@@ -514,6 +514,21 @@
"name"
:
"关联/取消关联用例"
,
"resourceId"
:
"PROJECT_TRACK_PLAN"
},
{
"id"
:
"PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE"
,
"name"
:
"批量取消关联用例"
,
"resourceId"
:
"PROJECT_TRACK_PLAN"
},
{
"id"
:
"PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN"
,
"name"
:
"批量执行用例"
,
"resourceId"
:
"PROJECT_TRACK_PLAN"
},
{
"id"
:
"PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT"
,
"name"
:
"批量编辑用例"
,
"resourceId"
:
"PROJECT_TRACK_PLAN"
},
{
"id"
:
"PROJECT_API_DEFINITION:READ"
,
"name"
:
"查询接口"
,
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/track/case/components/ShowMoreBtn.vue
+
1
-
1
View file @
a33111de
...
...
@@ -6,7 +6,7 @@
</div>
<el-dropdown-menu
slot=
"dropdown"
class=
"dropdown-menu-class"
>
<div
class=
"show-more-btn-title"
>
{{
$t
(
'
test_track.case.batch_handle
'
,
[
size
])
}}
</div>
<el-dropdown-item
v-for=
"(btn,index) in buttons"
:key=
"index"
@
click.native.stop=
"click(btn)"
>
<el-dropdown-item
v-for=
"(btn,index) in buttons"
v-permission=
"btn.permission ? btn.permission: []"
:key=
"index"
@
click.native.stop=
"click(btn)"
>
{{
btn
.
name
}}
</el-dropdown-item>
</el-dropdown-menu>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue
+
3
-
3
View file @
a33111de
...
...
@@ -230,9 +230,9 @@ export default {
deletePath
:
"
/test/case/delete
"
,
selectRows
:
new
Set
(),
buttons
:
[
{
name
:
this
.
$t
(
'
test_track.case.batch_unlink
'
),
handleClick
:
this
.
handleDeleteBatch
},
{
name
:
this
.
$t
(
'
api_test.automation.batch_execute
'
),
handleClick
:
this
.
handleBatchExecute
},
{
name
:
this
.
$t
(
'
test_track.case.batch_edit_case
'
),
handleClick
:
this
.
handleBatchEdit
}
{
name
:
this
.
$t
(
'
test_track.case.batch_unlink
'
),
handleClick
:
this
.
handleDeleteBatch
,
permission
:
[
'
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
(
'
test_track.case.batch_edit_case
'
),
handleClick
:
this
.
handleBatchEdit
,
permission
:
[
'
PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT
'
]
}
],
typeArr
:
[
{
id
:
'
projectEnv
'
,
name
:
this
.
$t
(
'
api_test.definition.request.run_env
'
)},
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue
+
5
-
3
View file @
a33111de
...
...
@@ -205,12 +205,14 @@ export default {
...
API_SCENARIO_FILTERS
,
buttons
:
[
{
name
:
this
.
$t
(
'
test_track.case.batch_unlink
'
),
handleClick
:
this
.
handleDeleteBatch
name
:
this
.
$t
(
'
test_track.case.batch_unlink
'
),
handleClick
:
this
.
handleDeleteBatch
,
permission
:
[
'
PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE
'
]
},
{
name
:
this
.
$t
(
'
api_test.automation.batch_execute
'
),
handleClick
:
this
.
handleBatchExecute
name
:
this
.
$t
(
'
api_test.automation.batch_execute
'
),
handleClick
:
this
.
handleBatchExecute
,
permission
:
[
'
PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN
'
]
},
{
name
:
this
.
$t
(
'
test_track.case.batch_edit_case
'
),
handleClick
:
this
.
handleBatchEdit
}
{
name
:
this
.
$t
(
'
test_track.case.batch_edit_case
'
),
handleClick
:
this
.
handleBatchEdit
,
permission
:
[
'
PROJECT_TRACK_PLAN:READ+CASE_BATCH_EDIT
'
]
}
],
selectRows
:
new
Set
(),
typeArr
:
[
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue
+
2
-
2
View file @
a33111de
...
...
@@ -360,10 +360,10 @@ export default {
showMore
:
false
,
buttons
:
[
{
name
:
this
.
$t
(
'
test_track.case.batch_edit_case
'
),
handleClick
:
this
.
handleBatchEdit
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_unlink
'
),
handleClick
:
this
.
handleDeleteBatch
name
:
this
.
$t
(
'
test_track.case.batch_unlink
'
),
handleClick
:
this
.
handleDeleteBatch
,
permission
:
[
'
PROJECT_TRACK_PLAN:READ+CASE_BATCH_DELETE
'
]
}
],
typeArr
:
[
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue
+
2
-
2
View file @
a33111de
...
...
@@ -199,10 +199,10 @@ export default {
screenHeight
:
'
calc(100vh - 330px)
'
,
//屏幕高度
buttons
:
[
{
name
:
this
.
$t
(
'
test_track.plan.load_case.unlink_in_bulk
'
),
handleClick
:
this
.
handleDeleteBatch
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.batch_exec_cases
'
),
handleClick
:
this
.
handleRunBatch
name
:
this
.
$t
(
'
test_track.plan.load_case.batch_exec_cases
'
),
handleClick
:
this
.
handleRunBatch
,
permission
:
[
'
PROJECT_TRACK_PLAN:READ+CASE_BATCH_RUN
'
]
}
],
statusFilters
:
[
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment