mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
1.1 KiB
1.1 KiB
Home > kibana-plugin-plugins-expressions-server > ExecutionContext > getSavedObject
ExecutionContext.getSavedObject property
Allows to fetch saved objects from ElasticSearch. In browser getSavedObject
function is provided automatically by the Expressions plugin. On the server the caller of the expression has to provide this context function. The reason is because on the browser we always know the user who tries to fetch a saved object, thus saved object client is scoped automatically to that user. However, on the server we can scope that saved object client to any user, or even not scope it at all and execute it as an "internal" user.
Signature:
getSavedObject?: <T extends SavedObjectAttributes = SavedObjectAttributes>(type: string, id: string) => Promise<SavedObject<T>>;