[PR #20243] [CLOSED] feat: Show Prompts/Models/Knowledge/Tools in Workspace when Read only - add proper visual cues for read only access #112829

Closed
opened 2026-05-18 13:02:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/20243
Author: @Classic298
Created: 12/29/2025
Status: Closed

Base: devHead: read


📝 Commits (7)

📊 Changes

18 files changed (+348 additions, -144 deletions)

View changed files

📝 backend/open_webui/models/models.py (+10 -1)
📝 backend/open_webui/models/prompts.py (+4 -0)
📝 backend/open_webui/models/tools.py (+4 -0)
📝 backend/open_webui/routers/knowledge.py (+6 -3)
📝 backend/open_webui/routers/models.py (+19 -2)
📝 backend/open_webui/routers/prompts.py (+14 -3)
📝 backend/open_webui/routers/tools.py (+15 -3)
📝 src/lib/components/common/CodeEditor.svelte (+8 -1)
📝 src/lib/components/workspace/Knowledge/KnowledgeBase.svelte (+5 -5)
📝 src/lib/components/workspace/Models.svelte (+15 -8)
📝 src/lib/components/workspace/Models/ModelEditor.svelte (+47 -31)
📝 src/lib/components/workspace/Prompts.svelte (+5 -0)
📝 src/lib/components/workspace/Prompts/PromptEditor.svelte (+47 -31)
📝 src/lib/components/workspace/Tools.svelte (+76 -32)
📝 src/lib/components/workspace/Tools/ToolkitEditor.svelte (+40 -20)
📝 src/routes/(app)/workspace/models/edit/+page.svelte (+16 -1)
📝 src/routes/(app)/workspace/prompts/edit/+page.svelte (+9 -2)
📝 src/routes/(app)/workspace/tools/edit/+page.svelte (+8 -1)

📄 Description

Read-Only visual indicators and access control enforcement for Workspace items

TL;DR: What does this PR do?

  1. If a prompt/model/knowledgebase/tool is shared to a group with READ permission, it will now be shown to other members in that group in the workspace section with a blue [READ ONLY] icon to clarify this item is read-only
  2. If another member of the group CLICKS on a workspace items with read-only permission, he can view it, but all fields to Save any changes are greyed out and there is a tooltip informing them they cannot save any changes because they have insufficient permissions
  3. PUBLICLY SHARED ITEMS like prompts, models etc. will ALSO be shown now in the workspace section, notably, also as [READ ONLY] labled items, so all other users receiving this publicly shared item will be able to view/see it but not edit nor save it.
  4. Administrators, unless disabled via BYPASS_ADMIN_ACCESS_CONTROL env var, still retain full write access to all items regardless of permissions being set (tested locally)

This PR enhances the UI/UX for workspace items (Prompts, Tools, Models, Knowledge Bases) by providing clear visual cues for read-only access and enforcing frontend restrictions.

Changes

Frontend

  • Workspace Lists: Added a "Read" badge to Prompts, Tools, Models, and updated Knowledge Bases to use a consistent indicator for items where the user lacks write permission.
  • Editors:
    • Updated Prompt, Tool, Model, and Knowledge Base editors to accept and respect a write_access flag.
    • Disabled all input fields for read-only items.
    • Disabled "Save" buttons and added tooltips explaining the permission restriction.

Backend

  • API Models: Updated response schemas for Prompts, Tools, and Models to include a write_access boolean.
  • Routers: Modified list endpoints to return all items with read access (instead of just write access) and correctly calculate the write_access status based on user role and permissions.

Addresses:

https://github.com/open-webui/open-webui/discussions/15315
https://github.com/open-webui/open-webui/issues/20048
https://github.com/open-webui/open-webui/discussions/19664
https://github.com/open-webui/open-webui/issues/19660

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/20243 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 12/29/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `read` --- ### 📝 Commits (7) - [`7fbeaf4`](https://github.com/open-webui/open-webui/commit/7fbeaf4bc309ddc47524779fc2a6622d514958a9) init - [`a12b79a`](https://github.com/open-webui/open-webui/commit/a12b79aa8a8a818bc36a099cb7b07fbe4e24aa4b) fix - [`da6b03b`](https://github.com/open-webui/open-webui/commit/da6b03b3d5d5caa7ced80f766d192b7a26bdc8af) fix - [`caa97c1`](https://github.com/open-webui/open-webui/commit/caa97c127ad4610ecffceba8b49faccfda2ea079) code quality - [`91f3a09`](https://github.com/open-webui/open-webui/commit/91f3a097924f94bdac763a6bb0fc26e3427be77e) fix - [`1af6c56`](https://github.com/open-webui/open-webui/commit/1af6c5694956ec3b8439c71dca87a554b9941b51) styling - [`8b2f46c`](https://github.com/open-webui/open-webui/commit/8b2f46c7e119dea6ffd85f334469193e213a7032) styling ### 📊 Changes **18 files changed** (+348 additions, -144 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/models.py` (+10 -1) 📝 `backend/open_webui/models/prompts.py` (+4 -0) 📝 `backend/open_webui/models/tools.py` (+4 -0) 📝 `backend/open_webui/routers/knowledge.py` (+6 -3) 📝 `backend/open_webui/routers/models.py` (+19 -2) 📝 `backend/open_webui/routers/prompts.py` (+14 -3) 📝 `backend/open_webui/routers/tools.py` (+15 -3) 📝 `src/lib/components/common/CodeEditor.svelte` (+8 -1) 📝 `src/lib/components/workspace/Knowledge/KnowledgeBase.svelte` (+5 -5) 📝 `src/lib/components/workspace/Models.svelte` (+15 -8) 📝 `src/lib/components/workspace/Models/ModelEditor.svelte` (+47 -31) 📝 `src/lib/components/workspace/Prompts.svelte` (+5 -0) 📝 `src/lib/components/workspace/Prompts/PromptEditor.svelte` (+47 -31) 📝 `src/lib/components/workspace/Tools.svelte` (+76 -32) 📝 `src/lib/components/workspace/Tools/ToolkitEditor.svelte` (+40 -20) 📝 `src/routes/(app)/workspace/models/edit/+page.svelte` (+16 -1) 📝 `src/routes/(app)/workspace/prompts/edit/+page.svelte` (+9 -2) 📝 `src/routes/(app)/workspace/tools/edit/+page.svelte` (+8 -1) </details> ### 📄 Description ## Read-Only visual indicators and access control enforcement for Workspace items # TL;DR: What does this PR do? 1. If a prompt/model/knowledgebase/tool is shared to a group with READ permission, **<ins>it will now be shown to other members in that group in the workspace section with a blue [READ ONLY] icon to clarify this item is read-only</ins>** 2. If another member of the group CLICKS on a workspace items with read-only permission, **<ins>he can view it, but all fields to Save any changes are **greyed out** and there is a tooltip informing them they cannot save any changes because they have insufficient permissions</ins>** 3. **<ins>PUBLICLY SHARED ITEMS like prompts, models etc. will ALSO be shown now in the workspace section, notably, also as [READ ONLY] labled items</ins>**, so all other users receiving this publicly shared item will be able to view/see it but not edit nor save it. 4. Administrators, unless disabled via BYPASS_ADMIN_ACCESS_CONTROL env var, <ins>**still retain full write access to all items regardless of permissions being set (tested locally)**</ins> This PR enhances the UI/UX for workspace items (Prompts, Tools, Models, Knowledge Bases) by providing clear visual cues for read-only access and enforcing frontend restrictions. ### Changes #### Frontend - **Workspace Lists**: Added a "Read" badge to Prompts, Tools, Models, and updated Knowledge Bases to use a consistent indicator for items where the user lacks write permission. - **Editors**: - Updated Prompt, Tool, Model, and Knowledge Base editors to accept and respect a `write_access` flag. - Disabled all input fields for read-only items. - Disabled "Save" buttons and added tooltips explaining the permission restriction. #### Backend - **API Models**: Updated response schemas for Prompts, Tools, and Models to include a `write_access` boolean. - **Routers**: Modified list endpoints to return all items with read access (instead of just write access) and correctly calculate the `write_access` status based on user role and permissions. # Addresses: https://github.com/open-webui/open-webui/discussions/15315 https://github.com/open-webui/open-webui/issues/20048 https://github.com/open-webui/open-webui/discussions/19664 https://github.com/open-webui/open-webui/issues/19660 ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <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-05-18 13:02:16 -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#112829