mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Dropitem permission
This commit is contained in:
parent
e23d413f97
commit
91a58ce990
|
|
@ -38,7 +38,14 @@ const systemManage = {
|
|||
'OR'
|
||||
),
|
||||
folderDelete: () => false,
|
||||
auth: () => false,
|
||||
auth: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_APPLICATION_AUTH
|
||||
],
|
||||
'OR'
|
||||
),
|
||||
overview_embed: () =>
|
||||
hasPermission(
|
||||
[
|
||||
|
|
|
|||
|
|
@ -153,7 +153,12 @@ const systemManage = {
|
|||
chat_user_edit: () =>false,
|
||||
|
||||
|
||||
auth: () => false,
|
||||
auth: () =>
|
||||
hasPermission([
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_KNOWLEDGE_AUTH
|
||||
],'OR'
|
||||
),
|
||||
folderCreate: () => false,
|
||||
folderEdit: () => false,
|
||||
folderDelete: () => false,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ const systemManage = {
|
|||
delete: () =>
|
||||
hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_DELETE], 'OR'),
|
||||
|
||||
auth: () => false,
|
||||
auth: () =>
|
||||
hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_AUTH], 'OR'),
|
||||
folderCreate: () => false,
|
||||
folderEdit: () => false,
|
||||
folderDelete: () => false,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,14 @@ const systemManage = {
|
|||
'OR',
|
||||
),
|
||||
|
||||
auth: () => false,
|
||||
auth: () =>
|
||||
hasPermission(
|
||||
[
|
||||
RoleConst.ADMIN,
|
||||
PermissionConst.RESOURCE_TOOL_AUTH,
|
||||
],
|
||||
'OR',
|
||||
),
|
||||
folderCreate: () => false,
|
||||
folderEdit: () => false,
|
||||
folderDelete: () => false,
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ const PermissionConst = {
|
|||
|
||||
RESOURCE_MODEL_AUTH: new Permission('SYSTEM_RESOURCE_MODEL:READ+AUTH'),
|
||||
RESOURCE_APPLICATION_AUTH: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+AUTH'),
|
||||
RESOURCE_KNOWLEDGE_AUTH: new Permission('SYSTEM_RESOURCE_AUTH:READ+AUTH'),
|
||||
RESOURCE_KNOWLEDGE_AUTH: new Permission('SYSTEM_RESOURCE_KNOWLEDGE:READ+AUTH'),
|
||||
RESOURCE_TOOL_AUTH: new Permission('SYSTEM_RESOURCE_TOOL:READ+AUTH'),
|
||||
|
||||
APPEARANCE_SETTINGS_READ: new Permission('APPEARANCE_SETTINGS:READ'),
|
||||
|
|
|
|||
|
|
@ -401,6 +401,7 @@ const MoreFilledPermission = (item: any) => {
|
|||
permissionPrecise.value.generate(item.id) ||
|
||||
(permissionPrecise.value.edit(item.id) && apiType.value) === 'workspace' ||
|
||||
permissionPrecise.value.export(item.id) ||
|
||||
permissionPrecise.value.auth(item.id) ||
|
||||
permissionPrecise.value.delete(item.id) ||
|
||||
isSystemShare.value
|
||||
)
|
||||
|
|
|
|||
|
|
@ -167,7 +167,10 @@ const permissionPrecise = computed(() => {
|
|||
|
||||
const MoreFilledPermission = (id: any) => {
|
||||
return (
|
||||
permissionPrecise.value.modify(id) || permissionPrecise.value.delete(id) || isSystemShare.value
|
||||
permissionPrecise.value.modify(id) ||
|
||||
permissionPrecise.value.delete(id) ||
|
||||
permissionPrecise.value.auth(id) ||
|
||||
isSystemShare.value
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ const paginationConfig = reactive({
|
|||
|
||||
// sync generete edit export delete
|
||||
const MoreFilledPermission = () => {
|
||||
return permissionPrecise.value.delete() || permissionPrecise.value.auth()
|
||||
return permissionPrecise.value.delete() || permissionPrecise.value.modify()
|
||||
}
|
||||
|
||||
const ResourceAuthorizationDrawerRef = ref()
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@
|
|||
<AppIcon iconName="app-export" class="color-secondary"></AppIcon>
|
||||
{{ $t('common.export') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="row.tool_type === 'MCP'" @click.stop="showMcpConfig(row)">
|
||||
<el-dropdown-item v-if="row.tool_type === 'MCP' && permissionPrecise.edit()" @click.stop="showMcpConfig(row)">
|
||||
<AppIcon iconName="app-operate-log" class="color-secondary"></AppIcon>
|
||||
{{ $t('views.tool.mcpConfig') }}
|
||||
</el-dropdown-item>
|
||||
|
|
|
|||
|
|
@ -386,6 +386,7 @@ const MoreFieldPermission = (id: any) => {
|
|||
permissionPrecise.value.edit(id) ||
|
||||
permissionPrecise.value.export(id) ||
|
||||
permissionPrecise.value.delete(id) ||
|
||||
permissionPrecise.value.auth(id) ||
|
||||
isSystemShare.value
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue