Skip to content

Commit e4b8b01

Browse files
committed
Revert "fix: enhance tool authorization logic to include shared tools"
This reverts commit defd168.
1 parent cb8fc7a commit e4b8b01

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

‎apps/application/serializers/application.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def get_authorized_tool_ids(user_id: str, workspace_id: str, tool_ids: List[str]
202202
"""
203203
返回 tool_ids 中当前用户被授权绑定/使用的工具id。
204204
工作空间管理员默认拥有全部工具权限;其他用户必须在 workspace_user_resource_permission
205-
中存在针对工作空间工具的显式授权记录;共享工具按共享工作空间授权校验。
205+
中存在针对该工具的显式授权记录(默认拒绝)。
206206
"""
207207
if not tool_ids:
208208
return []
@@ -219,12 +219,6 @@ def get_authorized_tool_ids(user_id: str, workspace_id: str, tool_ids: List[str]
219219
)
220220
if "VIEW" in permission.permission_list or "ROLE" in permission.permission_list
221221
}
222-
get_authorized_tool = DatabaseModelManage.get_model("get_authorized_tool")
223-
if get_authorized_tool is not None:
224-
shared_tool_query_set = QuerySet(Tool).filter(id__in=tool_ids, scope=ToolScope.SHARED)
225-
granted_tool_ids.update(
226-
str(tool.id) for tool in get_authorized_tool(shared_tool_query_set, workspace_id)
227-
)
228222
return [tool_id for tool_id in tool_ids if tool_id in granted_tool_ids]
229223

230224

0 commit comments

Comments
 (0)