From 85731f400c348cee34e13a47ae73bb07a9f6cf14 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 17 Nov 2024 17:40:31 -0800 Subject: [PATCH] refac: access control --- .../workspace/common/AccessControl.svelte | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib/components/workspace/common/AccessControl.svelte b/src/lib/components/workspace/common/AccessControl.svelte index 97ceb6d5a..be2c8a2af 100644 --- a/src/lib/components/workspace/common/AccessControl.svelte +++ b/src/lib/components/workspace/common/AccessControl.svelte @@ -18,6 +18,21 @@ onMount(async () => { groups = await getGroups(localStorage.token); + + if (accessControl === null) { + accessControl = null; + } else { + accessControl = { + read: { + group_ids: accessControl?.read?.group_ids ?? [], + user_ids: accessControl?.read?.user_ids ?? [] + }, + write: { + group_ids: accessControl?.write?.group_ids ?? [], + user_ids: accessControl?.write?.user_ids ?? [] + } + }; + } }); $: onChange(accessControl);