[PR #22409] [CLOSED] fix: add missing has_access import in tools router #49714

Closed
opened 2026-04-30 02:01:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22409
Author: @gambletan
Created: 3/8/2026
Status: Closed

Base: mainHead: fix/missing-has-access-import


📝 Commits (1)

  • 8851d38 fix: add missing has_access import in tools router

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 backend/open_webui/routers/tools.py (+1 -1)

📄 Description

Summary

  • Adds the missing has_access import from open_webui.utils.access_control in backend/open_webui/routers/tools.py
  • Without this import, the get_tools endpoint raises NameError: name 'has_access' is not defined for all non-admin users, returning HTTP 500 and hiding all tools
  • The function is called on line 174 when filtering tool access for non-admin users with server-type tools

Fixes #22393

Test plan

  • Log in as a non-admin user and verify GET /api/v1/tools/ returns 200 with the correct tool list
  • Log in as an admin user and verify tools still load correctly
  • Verify server-type tools with access grants are correctly filtered for non-admin users

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22409 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/missing-has-access-import` --- ### 📝 Commits (1) - [`8851d38`](https://github.com/open-webui/open-webui/commit/8851d384bad24bf039f931ec5115f090ac415d10) fix: add missing `has_access` import in tools router ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/tools.py` (+1 -1) </details> ### 📄 Description ## Summary - Adds the missing `has_access` import from `open_webui.utils.access_control` in `backend/open_webui/routers/tools.py` - Without this import, the `get_tools` endpoint raises `NameError: name 'has_access' is not defined` for all non-admin users, returning HTTP 500 and hiding all tools - The function is called on line 174 when filtering tool access for non-admin users with server-type tools Fixes #22393 ## Test plan - [ ] Log in as a non-admin user and verify GET /api/v1/tools/ returns 200 with the correct tool list - [ ] Log in as an admin user and verify tools still load correctly - [ ] Verify server-type tools with access grants are correctly filtered for non-admin users --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 02:01:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#49714