open-webui/backend/open_webui/utils
Alexey Rybalchenko 464a2dd58d feat: add per-group knowledge base file count and size limits
Adds optional per-group (and global default) limits on the number of
files and maximum file size for knowledge base uploads, enforced both
in the backend and early in the frontend upload pipeline.

- `WorkspacePermissions` extended with `knowledge_max_count` and
  `knowledge_max_size` (nullable int) so the group permissions endpoint
  persists and returns these values
- `DEFAULT_PERMISSIONS` in `permissions.ts` gains the two nullable fields
- Group Permissions UI shows numeric inputs for both limits beneath the
  Knowledge Access toggle (0 / empty = unlimited)
- `combine_permissions` extended to handle integer-valued permissions
  using most-permissive semantics (0 = unlimited always wins, otherwise
  max across groups)
- New `get_permission_value()` utility mirrors `has_permission` but
  returns the raw value (int/bool/None) rather than a boolean
- `/api/config` resolves and exposes `knowledge.max_count` and
  `knowledge.max_size` per-user so the frontend can gate uploads before
  any processing begins
- `KnowledgeBase.svelte` and `Models/Knowledge.svelte` check limits
  before calling `uploadFile`, preventing unnecessary text-extraction
  work on oversized files
- Backend enforces limits in both `/{id}/file/add` and
  `/{id}/files/batch/add`; admins always bypass
2026-04-22 13:52:31 +02:00
..
access_control feat: add per-group knowledge base file count and size limits 2026-04-22 13:52:31 +02:00
images refac 2026-04-15 10:17:40 -07:00
mcp refac: async db 2026-04-12 14:22:11 -05:00
telemetry refac: async db 2026-04-12 14:22:11 -05:00
actions.py refac: async db 2026-04-12 14:22:11 -05:00
anthropic.py chore: format 2026-04-14 17:27:31 -05:00
asgi_middleware.py chore: format 2026-04-14 17:27:31 -05:00
audit.py refac 2026-04-12 16:25:01 -05:00
auth.py chore: format 2026-04-12 18:12:59 -05:00
automations.py refac 2026-04-21 13:51:39 +09:00
calendar.py feat: calendar 2026-04-19 19:15:05 +09:00
channels.py refac 2026-03-17 17:58:01 -05:00
chat.py refac 2026-04-20 08:53:06 +09:00
code_interpreter.py refac 2026-03-17 17:58:01 -05:00
embeddings.py refac: async db 2026-04-12 14:22:11 -05:00
files.py chore: format 2026-04-21 15:52:00 +09:00
filter.py refac: async db 2026-04-12 14:22:11 -05:00
groups.py refac: async db 2026-04-12 14:22:11 -05:00
headers.py refac 2026-03-17 17:58:01 -05:00
logger.py refac 2026-04-10 10:15:55 -07:00
middleware.py refac 2026-04-21 14:31:04 +09:00
misc.py refac 2026-04-21 13:18:54 +09:00
models.py chore: format 2026-04-17 14:28:18 +09:00
oauth.py refac 2026-04-21 16:05:26 +09:00
payload.py refac 2026-04-14 16:47:43 -05:00
pdf_generator.py refac 2026-03-17 17:58:01 -05:00
plugin.py refac: async db 2026-04-12 14:22:11 -05:00
rate_limit.py refac 2026-03-17 17:58:01 -05:00
redis.py chore: format 2026-04-12 18:12:59 -05:00
response.py refac 2026-03-24 04:49:48 -05:00
sanitize.py refac 2026-03-17 17:58:01 -05:00
security_headers.py refac 2026-04-20 09:10:48 +09:00
session_pool.py refac 2026-04-14 01:17:39 -05:00
task.py fix: Fix the error that occurs when the task model does not exist (#23169) 2026-04-01 07:01:25 -05:00
tools.py chore: format 2026-04-21 15:52:00 +09:00
validate.py chore: format 2026-04-12 18:12:59 -05:00
webhook.py refac 2026-04-20 08:34:15 +09:00