[PR #15985] [CLOSED] feat: add support access_control field on folder, like knowledge #23999

Closed
opened 2026-04-20 05:10:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/15985
Author: @blitzh
Created: 7/24/2025
Status: Closed

Base: devHead: custom-dev


📝 Commits (7)

📊 Changes

24 files changed (+96 additions, -46 deletions)

View changed files

📝 .gitignore (+2 -0)
backend/.python-version (+1 -0)
📝 backend/dev.sh (+1 -1)
📝 backend/open_webui/models/folders.py (+52 -13)
📝 backend/open_webui/routers/folders.py (+5 -1)
backend/open_webui/static/apple-touch-icon.png (+0 -0)
backend/open_webui/static/custom.css (+0 -0)
backend/open_webui/static/favicon-96x96.png (+0 -0)
backend/open_webui/static/favicon-dark.png (+0 -0)
backend/open_webui/static/favicon.ico (+0 -0)
backend/open_webui/static/favicon.png (+0 -0)
backend/open_webui/static/favicon.svg (+0 -3)
backend/open_webui/static/loader.js (+0 -0)
backend/open_webui/static/logo.png (+0 -0)
backend/open_webui/static/site.webmanifest (+0 -21)
backend/open_webui/static/splash-dark.png (+0 -0)
backend/open_webui/static/splash.png (+0 -0)
backend/open_webui/static/user-import.csv (+0 -1)
backend/open_webui/static/web-app-manifest-192x192.png (+0 -0)
backend/open_webui/static/web-app-manifest-512x512.png (+0 -0)

...and 4 more files

📄 Description

feat: add support access_control field on folder, like knowledge

Description

This pull request adds support for the access_control field when creating folders. Previously, folder permissions were hardcoded to default values (e.g. current user only), and any access_control provided by the frontend was ignored.

With this change:

  • The frontend can now pass a full access_control structure (including read and write groups/users)
  • The backend accepts and stores the value as-is if provided
  • Falls back to default values only if access_control is not specified

This is useful for controlling folder-level visibility across users and groups, supporting upcoming multi-user scenarios and group-based sharing in the Open WebUI interface.


Changelog

Added

  • New field access_control (type: JSON) added to folders table
  • Support for access_control in FolderForm Pydantic model
  • Insertion logic in insert_new_folder() updated to store frontend-provided access controls

Changed

  • Backend now uses form_data.access_control if available during folder creation

Fixed

  • Bug where folder access_control was always default, even if provided by the frontend

No Alembic migration is included in this PR — please add the column manually depending on your DB engine:

Database Migration

Ensure the folders table has a new column added:

ALTER TABLE folder ADD COLUMN access_control JSON DEFAULT NULL;

Or if using SQLite:

ALTER TABLE folder ADD COLUMN access_control TEXT DEFAULT NULL;

🔄 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/15985 **Author:** [@blitzh](https://github.com/blitzh) **Created:** 7/24/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `custom-dev` --- ### 📝 Commits (7) - [`70c6c7a`](https://github.com/open-webui/open-webui/commit/70c6c7a48fa44519609dd7046cc8f539bbccdd5b) tst - [`ba52b36`](https://github.com/open-webui/open-webui/commit/ba52b36184e5e67ff14018fad8c672de75e06b67) aman - [`92bd0f6`](https://github.com/open-webui/open-webui/commit/92bd0f6050924cff8afcb0a1ef03323d2b9cbc7f) detele env local - [`f37b901`](https://github.com/open-webui/open-webui/commit/f37b90159241776ad45749bd82bcf26db72f82aa) add folder to user access_control - [`2768e9b`](https://github.com/open-webui/open-webui/commit/2768e9b4d206e599c2c008e5658fa3053025d577) add accessControl in folder - [`02051d0`](https://github.com/open-webui/open-webui/commit/02051d061f3d8aa6324b2ca2faa76c6574e33b50) fix access control at folder - [`a5adcc3`](https://github.com/open-webui/open-webui/commit/a5adcc388cfaad9532ee9bf9265bfbad721ea4b2) add gitignore ### 📊 Changes **24 files changed** (+96 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) ➕ `backend/.python-version` (+1 -0) 📝 `backend/dev.sh` (+1 -1) 📝 `backend/open_webui/models/folders.py` (+52 -13) 📝 `backend/open_webui/routers/folders.py` (+5 -1) ➖ `backend/open_webui/static/apple-touch-icon.png` (+0 -0) ➖ `backend/open_webui/static/custom.css` (+0 -0) ➖ `backend/open_webui/static/favicon-96x96.png` (+0 -0) ➖ `backend/open_webui/static/favicon-dark.png` (+0 -0) ➖ `backend/open_webui/static/favicon.ico` (+0 -0) ➖ `backend/open_webui/static/favicon.png` (+0 -0) ➖ `backend/open_webui/static/favicon.svg` (+0 -3) ➖ `backend/open_webui/static/loader.js` (+0 -0) ➖ `backend/open_webui/static/logo.png` (+0 -0) ➖ `backend/open_webui/static/site.webmanifest` (+0 -21) ➖ `backend/open_webui/static/splash-dark.png` (+0 -0) ➖ `backend/open_webui/static/splash.png` (+0 -0) ➖ `backend/open_webui/static/user-import.csv` (+0 -1) ➖ `backend/open_webui/static/web-app-manifest-192x192.png` (+0 -0) ➖ `backend/open_webui/static/web-app-manifest-512x512.png` (+0 -0) _...and 4 more files_ </details> ### 📄 Description ## feat: add support access_control field on folder, like knowledge ### Description This pull request adds support for the `access_control` field when creating folders. Previously, folder permissions were hardcoded to default values (e.g. current user only), and any `access_control` provided by the frontend was ignored. With this change: - The frontend can now pass a full `access_control` structure (including `read` and `write` groups/users) - The backend accepts and stores the value as-is if provided - Falls back to default values only if `access_control` is not specified This is useful for controlling folder-level visibility across users and groups, supporting upcoming multi-user scenarios and group-based sharing in the Open WebUI interface. --- ### Changelog #### Added - New field `access_control` (type: JSON) added to `folders` table - Support for `access_control` in `FolderForm` Pydantic model - Insertion logic in `insert_new_folder()` updated to store frontend-provided access controls #### Changed - Backend now uses `form_data.access_control` if available during folder creation #### Fixed - Bug where folder `access_control` was always default, even if provided by the frontend No Alembic migration is included in this PR — please add the column manually depending on your DB engine: #### Database Migration Ensure the `folders` table has a new column added: ```sql ALTER TABLE folder ADD COLUMN access_control JSON DEFAULT NULL; ``` Or if using SQLite: ```sqlite ALTER TABLE folder ADD COLUMN access_control TEXT DEFAULT NULL; ``` --- <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-20 05:10:34 -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#23999