[PR #22414] [CLOSED] fix: add missing has_access import in tools router #42301

Closed
opened 2026-04-25 14:15:14 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: devHead: fix/missing-has-access-import-dev


📝 Commits (1)

  • a511949 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

By submitting this pull request, I agree to the Contributor License Agreement.


🔄 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/22414 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/8/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/missing-has-access-import-dev` --- ### 📝 Commits (1) - [`a511949`](https://github.com/open-webui/open-webui/commit/a511949d405838e8934b4fe9b8b4c19524bd2d7b) 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 --- **By submitting this pull request, I agree to the [Contributor License Agreement](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT).** --- <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-25 14:15: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#42301