feat: System chat user group permission
This commit is contained in:
parent
d251d2bff4
commit
8e6ca99ef6
@ -44,7 +44,13 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<el-button @click="submit(authFormRef)" type="primary" :disabled="loading">
|
<el-button @click="submit(authFormRef)" type="primary" :disabled="loading"
|
||||||
|
v-hasPermission="
|
||||||
|
new ComplexPermission(
|
||||||
|
[RoleConst.ADMIN],
|
||||||
|
[PermissionConst.USER_GROUP_REMOVE_MEMBER],
|
||||||
|
[],'OR',)"
|
||||||
|
>
|
||||||
{{ $t('common.save') }}
|
{{ $t('common.save') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -58,6 +64,8 @@ import authApi from '@/api/chat-user/auth-setting'
|
|||||||
import type {FormInstance, FormRules} from 'element-plus'
|
import type {FormInstance, FormRules} from 'element-plus'
|
||||||
import {t} from '@/locales'
|
import {t} from '@/locales'
|
||||||
import {MsgSuccess} from '@/utils/message'
|
import {MsgSuccess} from '@/utils/message'
|
||||||
|
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
||||||
|
import { ComplexPermission } from '@/utils/permission/type'
|
||||||
|
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
id: '',
|
id: '',
|
||||||
|
|||||||
@ -23,12 +23,9 @@
|
|||||||
@click="createOrUpdate()"
|
@click="createOrUpdate()"
|
||||||
v-hasPermission="
|
v-hasPermission="
|
||||||
new ComplexPermission(
|
new ComplexPermission(
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
[PermissionConst.WORKSPACE_USER_GROUP_CREATE.getWorkspacePermission],
|
[PermissionConst.WORKSPACE_USER_GROUP_CREATE, PermissionConst.USER_GROUP_CREATE],
|
||||||
[],
|
[],'OR',)"
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<el-icon :size="18"><Plus /></el-icon>
|
<el-icon :size="18"><Plus /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -67,20 +64,10 @@
|
|||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
@click.stop="createOrUpdate(row)"
|
@click.stop="createOrUpdate(row)"
|
||||||
class="p-8"
|
class="p-8"
|
||||||
v-if="
|
v-if="hasPermission(new ComplexPermission(
|
||||||
hasPermission(
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
new ComplexPermission(
|
[PermissionConst.WORKSPACE_USER_GROUP_EDIT, PermissionConst.USER_GROUP_EDIT],
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
[],'OR',),'OR',)"
|
||||||
[
|
|
||||||
PermissionConst.WORKSPACE_USER_GROUP_EDIT
|
|
||||||
.getWorkspacePermission,
|
|
||||||
],
|
|
||||||
[],
|
|
||||||
'OR',
|
|
||||||
),
|
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<el-icon><EditPen /></el-icon>
|
<el-icon><EditPen /></el-icon>
|
||||||
{{ $t('common.rename') }}
|
{{ $t('common.rename') }}
|
||||||
@ -88,21 +75,10 @@
|
|||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
@click.stop="deleteGroup(row)"
|
@click.stop="deleteGroup(row)"
|
||||||
class="border-t p-8"
|
class="border-t p-8"
|
||||||
v-if="
|
v-if="hasPermission(new ComplexPermission(
|
||||||
row.id !== 'default' &&
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
hasPermission(
|
[PermissionConst.WORKSPACE_USER_GROUP_DELETE, PermissionConst.USER_GROUP_DELETE],
|
||||||
new ComplexPermission(
|
[],'OR',),'OR',)"
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
|
||||||
[
|
|
||||||
PermissionConst.WORKSPACE_USER_GROUP_DELETE
|
|
||||||
.getWorkspacePermission,
|
|
||||||
],
|
|
||||||
[],
|
|
||||||
'OR',
|
|
||||||
),
|
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
{{ $t('common.delete') }}
|
{{ $t('common.delete') }}
|
||||||
@ -143,12 +119,9 @@
|
|||||||
@click="createUser()"
|
@click="createUser()"
|
||||||
v-hasPermission="
|
v-hasPermission="
|
||||||
new ComplexPermission(
|
new ComplexPermission(
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
[PermissionConst.WORKSPACE_USER_GROUP_ADD_MEMBER.getWorkspacePermission],
|
[PermissionConst.WORKSPACE_USER_GROUP_ADD_MEMBER, PermissionConst.USER_GROUP_ADD_MEMBER],
|
||||||
[],
|
[],'OR',)"
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{ t('views.role.member.add') }}
|
{{ t('views.role.member.add') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -157,12 +130,9 @@
|
|||||||
@click="handleDeleteUser()"
|
@click="handleDeleteUser()"
|
||||||
v-hasPermission="
|
v-hasPermission="
|
||||||
new ComplexPermission(
|
new ComplexPermission(
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
[PermissionConst.WORKSPACE_USER_GROUP_DELETE.getWorkspacePermission],
|
[PermissionConst.WORKSPACE_USER_GROUP_REMOVE_MEMBER, PermissionConst.USER_GROUP_REMOVE_MEMBER],
|
||||||
[],
|
[],'OR',)"
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{ $t('common.remove') }}
|
{{ $t('common.remove') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -221,12 +191,9 @@
|
|||||||
@click.stop="handleDeleteUser(row)"
|
@click.stop="handleDeleteUser(row)"
|
||||||
v-hasPermission="
|
v-hasPermission="
|
||||||
new ComplexPermission(
|
new ComplexPermission(
|
||||||
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE.getWorkspaceRole],
|
[RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE],
|
||||||
[PermissionConst.WORKSPACE_USER_GROUP_REMOVE_MEMBER.getWorkspacePermission],
|
[PermissionConst.WORKSPACE_USER_GROUP_REMOVE_MEMBER, PermissionConst.USER_GROUP_REMOVE_MEMBER],
|
||||||
[],
|
[],'OR',)"
|
||||||
'OR',
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<EditPen />
|
<EditPen />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user