Skip to content

Commit e724ffb

Browse files
committed
refactor: simplify query set handling in tool.py and list_tool_user.sql
1 parent fedf1ef commit e724ffb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/tools/serializers/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def get_query_set(self, workspace_manage, is_x_pack_ee):
606606
'tool_query_set': tool_query_set,
607607
'default_query_set': default_query_set,
608608
}
609-
if not workspace_manage and is_x_pack_ee:
609+
if not workspace_manage:
610610
query_set_dict['workspace_user_resource_permission_query_set'] = QuerySet(
611611
WorkspaceUserResourcePermission).filter(
612612
auth_target_type="TOOL",

apps/tools/sql/list_tool_user.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ FROM (SELECT tool."id"::text,
2121
FROM tool tool ${tool_query_set}
2222
AND tool.id IN (SELECT target
2323
FROM workspace_user_resource_permission
24-
WHERE auth_target_type = 'TOOL'
24+
${workspace_user_resource_permission_query_set}
2525
AND 'VIEW' = ANY (permission_list))) AS tool
2626
LEFT JOIN "user" ON "user".id = user_id
2727

0 commit comments

Comments
 (0)