From 521750da0cb32c348aa08dc75609bed6f8cdff27 Mon Sep 17 00:00:00 2001 From: Yiping Kang Date: Thu, 22 Jun 2023 12:28:58 -0400 Subject: [PATCH] Add an API that make a sentinel globally accessible --- jaseci_core/jaseci/extens/api/global_api.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jaseci_core/jaseci/extens/api/global_api.py b/jaseci_core/jaseci/extens/api/global_api.py index 09e254f7e5..b8a0d9b5ab 100644 --- a/jaseci_core/jaseci/extens/api/global_api.py +++ b/jaseci_core/jaseci/extens/api/global_api.py @@ -42,17 +42,26 @@ def global_delete(self, name: str): @Interface.admin_api() def global_sentinel_set(self, snt: Sentinel = None): """ - Set sentinel as globally accessible + Make a sentinel globally accessible and set it as the global sentinel """ snt.make_read_only() snt.propagate_access() self._h.save_glob("GLOB_SENTINEL", snt.jid) return {"response": f"Global sentinel set to '{snt}'!"} + @Interface.admin_api() + def global_sentinel_set_access(self, snt: Sentinel = None): + """ + Make a sentinel globally accessible + """ + snt.make_read_only() + snt.propagate_access() + return {"response": f"Sentinel '{snt}' is now globally accessible."} + @Interface.admin_api() def global_sentinel_unset(self): """ - Set sentinel as globally accessible + Unset a global sentinel """ current = self.global_get("GLOB_SENTINEL")["value"] if current: