mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
refactor: simplify query set handling in tool.py and list_tool_user.sql
This commit is contained in:
parent
fedf1ef6fc
commit
e724ffbebd
|
|
@ -606,7 +606,7 @@ class ToolTreeSerializer(serializers.Serializer):
|
|||
'tool_query_set': tool_query_set,
|
||||
'default_query_set': default_query_set,
|
||||
}
|
||||
if not workspace_manage and is_x_pack_ee:
|
||||
if not workspace_manage:
|
||||
query_set_dict['workspace_user_resource_permission_query_set'] = QuerySet(
|
||||
WorkspaceUserResourcePermission).filter(
|
||||
auth_target_type="TOOL",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ FROM (SELECT tool."id"::text,
|
|||
FROM tool tool ${tool_query_set}
|
||||
AND tool.id IN (SELECT target
|
||||
FROM workspace_user_resource_permission
|
||||
WHERE auth_target_type = 'TOOL'
|
||||
${workspace_user_resource_permission_query_set}
|
||||
AND 'VIEW' = ANY (permission_list))) AS tool
|
||||
LEFT JOIN "user" ON "user".id = user_id
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue