mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
fix: preserve access_control when cloning prompts (#19960)
* fix: preserve access_control when cloning prompts
Cloned prompts now inherit the original prompt's access_control settings
instead of defaulting to null/public. This ensures that permission and
sharing restrictions are carried over with clones as expected.
If the original prompt doesn't have access_control set, defaults to {}
(private) which matches the behavior of newly created prompts.
Fixes #19360
* fix: clone access control
This commit is contained in:
parent
f509f5542d
commit
05a3aae59c
2 changed files with 3 additions and 3 deletions
|
|
@ -49,7 +49,7 @@
|
|||
title: _prompt.title,
|
||||
command: _prompt.command,
|
||||
content: _prompt.content,
|
||||
access_control: null
|
||||
access_control: _prompt.access_control !== undefined ? _prompt.access_control : {}
|
||||
};
|
||||
});
|
||||
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
title: _prompt.title,
|
||||
command: _prompt.command,
|
||||
content: _prompt.content,
|
||||
access_control: null
|
||||
access_control: _prompt.access_control !== undefined ? _prompt.access_control : {}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
name={tool?.name ?? ''}
|
||||
meta={tool?.meta ?? { description: '' }}
|
||||
content={tool?.content ?? ''}
|
||||
access_control={null}
|
||||
accessControl={tool?.access_control !== undefined ? tool.access_control : {}}
|
||||
{clone}
|
||||
onSave={(value) => {
|
||||
saveHandler(value);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue