fix(工作空间权限): 细化工作空间项目管理的权限

--bug=1013628 --user=刘瑞斌 【系统设置】工作空间成员管理批量添加到项目未受权限配置限制 https://www.tapd.cn/55049933/s/1167242
This commit is contained in:
CaptainB 2022-05-28 09:35:48 +08:00 committed by f2c-ci-robot[bot]
parent 48e22f8595
commit 43d721d684
3 changed files with 23 additions and 6 deletions

View File

@ -185,6 +185,21 @@
"name": "permission.workspace_project_manager.upload_jar",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+ADD_USER",
"name": "permission.workspace_user.create",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+EDIT_USER",
"name": "permission.workspace_user.edit",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_MANAGER:READ+DELETE_USER",
"name": "permission.workspace_user.delete",
"resourceId": "WORKSPACE_PROJECT_MANAGER"
},
{
"id": "WORKSPACE_PROJECT_ENVIRONMENT:READ",
"name": "permission.workspace_project_environment.read",

View File

@ -100,7 +100,7 @@
class="dialog-css">
<template v-slot:title>
<ms-table-header :condition.sync="dialogCondition" @create="open" @search="list" :have-search="false"
:create-permission="['WORKSPACE_USER:READ+CREATE']"
:create-permission="['WORKSPACE_PROJECT_MANAGER:READ+ADD_USER']"
:create-tip="$t('member.create')" :title="$t('commons.member')"/>
</template>
<div>
@ -118,8 +118,8 @@
<template v-slot:default="scope">
<div>
<ms-table-operator :tip2="$t('commons.remove')"
:edit-permission="['WORKSPACE_USER:READ+EDIT']"
:delete-permission="['WORKSPACE_USER:READ+DELETE']"
:edit-permission="['WORKSPACE_PROJECT_MANAGER:READ+EDIT_USER']"
:delete-permission="['WORKSPACE_PROJECT_MANAGER:READ+DELETE_USER']"
@editClick="editMember(scope.row)"
@deleteClick="delMember(scope.row)"/>
</div>

View File

@ -11,7 +11,7 @@
@select-all="handleSelectAll"
@select="handleSelect"
ref="userTable">
<el-table-column type="selection" width="50"/>
<el-table-column v-if="hasPermission('WORKSPACE_PROJECT_MANAGER:READ+ADD_USER')" type="selection" width="50"/>
<ms-table-header-select-popover v-show="total>0"
:page-size="pageSize>total?total:pageSize"
:total="total"
@ -21,7 +21,8 @@
@selectAll="isSelectDataAll(true)"/>
<el-table-column width="30" min-width="30" :resizable="false" align="center">
<template v-slot:default="scope">
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectDataCounts"/>
<show-more-btn v-permission="['WORKSPACE_PROJECT_MANAGER:READ+ADD_USER']"
:is-show="scope.row.showMore" :buttons="buttons" :size="selectDataCounts"/>
</template>
</el-table-column>
<el-table-column prop="id" label="ID"/>
@ -101,7 +102,7 @@ import MsDialogFooter from "../../common/components/MsDialogFooter";
import {
getCurrentProjectID,
getCurrentUser,
getCurrentWorkspaceId,
getCurrentWorkspaceId, hasPermission,
listenGoBack,
removeGoBackListener
} from "@/common/js/utils";
@ -172,6 +173,7 @@ export default {
this.initTableData();
},
methods: {
hasPermission,
currentUser: () => {
return getCurrentUser();
},