Skip to content

Commit f6b36b7

Browse files
committed
fix: Update visibility handling after user profile retrieval and enhance permission checks in dropdown items
1 parent 1bb2a1a commit f6b36b7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ui/src/views/tool/ToolFormDrawer.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,9 @@ const submit = async (formEl: FormInstance | undefined) => {
431431
.then((res: any) => {
432432
MsgSuccess(t('common.editSuccess'))
433433
emit('refresh', res.data)
434-
visible.value = false
434+
return user.profile()
435435
})
436+
.then(() => {visible.value = false})
436437
} else {
437438
const obj = {
438439
folder_id: folder.currentFolder?.id,
@@ -443,8 +444,9 @@ const submit = async (formEl: FormInstance | undefined) => {
443444
.then((res: any) => {
444445
MsgSuccess(t('common.createSuccess'))
445446
emit('refresh')
446-
visible.value = false
447+
return user.profile()
447448
})
449+
.then(() => {visible.value = false})
448450
}
449451
}
450452
})

ui/src/views/tool/component/ToolListContainer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
<template #dropdown>
214214
<el-dropdown-menu>
215215
<el-dropdown-item
216-
v-if="item.template_id"
216+
v-if="item.template_id && permissionPrecise.edit(item.id)"
217217
@click.stop="addInternalTool(item, true)"
218218
>
219219
<el-icon>
@@ -238,7 +238,7 @@
238238
{{ $t('common.copy') }}
239239
</el-dropdown-item>
240240
<el-dropdown-item
241-
v-if="item.init_field_list?.length > 0"
241+
v-if="item.init_field_list?.length > 0 && permissionPrecise.edit(item.id)"
242242
@click.stop="configInitParams(item)"
243243
>
244244
<AppIcon iconName="app-operation" class="mr-4"></AppIcon>

0 commit comments

Comments
 (0)