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:
G30
2025-12-16 13:56:28 -05:00
committed by GitHub
parent f509f5542d
commit 05a3aae59c
2 changed files with 3 additions and 3 deletions

View File

@@ -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 : {}
};
}
});

View File

@@ -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);