This commit is contained in:
Timothy Jaeryang Baek
2026-02-09 13:28:21 -06:00
parent f7406ff576
commit 3c7f9aa6a4
27 changed files with 789 additions and 253 deletions
@@ -75,6 +75,8 @@
file_ids: string[];
};
files: any[];
access_grants?: any[];
write_access?: boolean;
};
let id = null;
@@ -614,7 +616,7 @@
...knowledge,
name: knowledge.name,
description: knowledge.description,
access_control: knowledge.access_control
access_grants: knowledge.access_grants ?? []
}).catch((e) => {
toast.error(`${e}`);
});
@@ -745,6 +747,9 @@
if (res) {
knowledge = res;
if (!Array.isArray(knowledge?.access_grants)) {
knowledge.access_grants = [];
}
knowledgeId = knowledge?.id;
} else {
goto('/workspace/knowledge');
@@ -828,9 +833,11 @@
{#if id && knowledge}
<AccessControlModal
bind:show={showAccessControlModal}
bind:accessControl={knowledge.access_control}
bind:accessGrants={knowledge.access_grants}
share={$user?.permissions?.sharing?.knowledge || $user?.role === 'admin'}
sharePublic={$user?.permissions?.sharing?.public_knowledge || $user?.role === 'admin'}
sharePublic={$user?.permissions?.sharing?.public_knowledge ||
$user?.role === 'admin' ||
knowledge?.write_access}
onChange={() => {
changeDebounceHandler();
}}