mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 19:38:46 -05:00
[PR #19960] [MERGED] fix: preserve access_control when cloning prompts #41043
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/19960
Author: @silentoplayz
Created: 12/15/2025
Status: ✅ Merged
Merged: 12/16/2025
Merged by: @tjbck
Base:
dev← Head:fix/issue-19360-prompt-clone-access-control📝 Commits (2)
0957abcfix: preserve access_control when cloning promptsd6d9b04fix: clone access control📊 Changes
2 files changed (+3 additions, -3 deletions)
View changed files
📝
src/routes/(app)/workspace/prompts/create/+page.svelte(+2 -2)📝
src/routes/(app)/workspace/tools/create/+page.svelte(+1 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch will lead to immediate closure of the PR.Changelog Entry
Description
access_controlsettings. When a prompt was cloned, theaccess_controlproperty was explicitly set tonull, causing the cloned prompt to default to public access instead of inheriting the original's access permissions.access_controlvsaccessControl) that prevented access control from being passed to the editor at all.Changed
Prompts:
Modified
/workspace/prompts/create/+page.svelte(lines 52, 71) to preserveaccess_controlusing!== undefinedcheck instead of hardcoding tonull.Tools:
/workspace/tools/create/+page.svelte(line 90) to:access_controlusing!== undefinedcheckaccess_controltoaccessControlto match ToolkitEditor's expected propWhy
!== undefinedinstead of??operator: The nullish coalescing operator (??) treats bothnullandundefinedas falsy, which would incorrectly convert public items (null) to private ({}). By explicitly checking!== undefined, we preserve:Public (
null) → staysnull✅Private (
{}) → stays{}✅Custom permissions → stays preserved ✅
Undefined → defaults to
{}(private) ✅Fixed
access_controlfrom the original.access_controlfrom the original.access_controlvsaccessControl).Security
Additional Information
ModelEditor.svelteand do not need changes.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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.