mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-25 05:54:29 +00:00
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
|
||
|---|---|---|
| .. | ||
| data | ||
| internal | ||
| migrations | ||
| models | ||
| retrieval | ||
| routers | ||
| socket | ||
| static | ||
| storage | ||
| test | ||
| tools | ||
| utils | ||
| __init__.py | ||
| alembic.ini | ||
| config.py | ||
| constants.py | ||
| env.py | ||
| functions.py | ||
| main.py | ||
| tasks.py | ||