Skip to content

Commit 3af54bc

Browse files
fix: Regular users can create ds on chat
1 parent bc19f0a commit 3af54bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/src/views/chat/ChatCreator.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import { chatApi, ChatInfo } from '@/api/chat.ts'
88
import { datasourceApi } from '@/api/datasource.ts'
99
import Card from '@/views/ds/ChatCard.vue'
1010
import AddDrawer from '@/views/ds/AddDrawer.vue'
11+
import { useUserStore } from '@/stores/user'
1112
13+
const userStore = useUserStore()
14+
15+
const isWsAdmin = computed(() => userStore.isAdmin || userStore.isSpaceAdmin)
1216
const props = withDefaults(
1317
defineProps<{
1418
hidden?: boolean
@@ -187,7 +191,7 @@ defineExpose({
187191
img-type="noneWhite"
188192
/>
189193

190-
<div style="text-align: center; margin-top: -10px">
194+
<div v-if="isWsAdmin" style="text-align: center; margin-top: -10px">
191195
<el-button type="primary" @click="handleAddDatasource">
192196
<template #icon>
193197
<icon_add_outlined></icon_add_outlined>

0 commit comments

Comments
 (0)