open-webui/backend/open_webui/routers
Classic298 e038bab66d
Authorize POST /api/v1/images/edit (enforce ENABLE_IMAGE_EDIT + image-gen permission) (#26009)
The direct image-edit route was the only image-edit surface with no authorization: it ran
on get_verified_user alone, while POST /generations enforces ENABLE_IMAGE_GENERATION +
features.image_generation and the built-in edit_image tool enforces ENABLE_IMAGE_EDIT +
features.image_generation. A verified non-admin user could therefore reach the configured
image-edit provider (spending IMAGES_EDIT_OPENAI_API_KEY) even when the administrator had
globally disabled image editing (ENABLE_IMAGE_EDIT=False) or denied the user image
generation.

Split the route from the shared impl (mirroring generate_images/image_generations): the new
/edit wrapper enforces ENABLE_IMAGE_EDIT and the per-user image-generation permission, then
delegates to image_edits(). The internal callers (the edit_image tool and the chat
middleware) already gate themselves and call image_edits() directly, so they are unaffected.

Co-authored-by: jagstack <52110932+jagstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 03:05:41 +02:00
..
analytics.py implement date picker and additional columns for analytics (#25922) 2026-06-17 03:03:18 +02:00
audio.py refac 2026-06-17 02:52:35 +02:00
auths.py refac 2026-06-17 02:52:35 +02:00
automations.py refac 2026-06-17 02:52:35 +02:00
calendar.py refac 2026-06-17 02:52:35 +02:00
channels.py refac 2026-06-17 02:52:35 +02:00
chats.py feat(ui): show total archived chat count in ChatsModal title (#25872) 2026-06-17 02:57:27 +02:00
configs.py refac 2026-06-17 02:52:35 +02:00
evaluations.py refac 2026-06-17 02:52:35 +02:00
files.py feat(ui): show total file count in FilesModal title (#25873) 2026-06-17 02:55:13 +02:00
folders.py refac 2026-06-17 02:52:35 +02:00
functions.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
groups.py chore: format 2026-06-01 13:56:55 -07:00
images.py Authorize POST /api/v1/images/edit (enforce ENABLE_IMAGE_EDIT + image-gen permission) (#26009) 2026-06-17 03:05:41 +02:00
knowledge.py refac 2026-06-17 02:52:35 +02:00
memories.py refac 2026-06-17 02:52:35 +02:00
models.py refac 2026-06-17 02:52:35 +02:00
notes.py refac 2026-06-17 02:52:35 +02:00
ollama.py refac 2026-06-17 02:52:35 +02:00
openai.py refac 2026-06-17 02:52:35 +02:00
pipelines.py refac 2026-06-17 02:52:35 +02:00
prompts.py refac 2026-06-17 02:52:35 +02:00
retrieval.py refac 2026-06-17 02:52:35 +02:00
scim.py refac 2026-06-17 02:52:35 +02:00
skills.py refac 2026-06-17 02:52:35 +02:00
tasks.py refac 2026-06-17 02:58:11 +02:00
terminals.py refac 2026-06-17 02:52:35 +02:00
tools.py refac 2026-06-17 02:52:35 +02:00
users.py refac 2026-06-17 02:52:35 +02:00
utils.py refac 2026-06-17 02:52:35 +02:00