From 0035a9dad9eb09bbed560b90b6765bfa8f4e417b Mon Sep 17 00:00:00 2001 From: xarmian Date: Tue, 5 May 2026 09:04:28 -0400 Subject: [PATCH] feat(settings): gate collection management UI to owners (TASK-1103) (#417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settings → Collections currently shows "+ Create Collection" and clickable edit cards to all roles. The server already enforces owner-only on create, update, and delete (handlers_collections.go:48, :113, :164). UI now matches. Changes: - Collection cards remain clickable for owners (open EditCollectionModal); for non-owners they render as non-interactive divs with the same content visible. The "Edit" hint is hidden for non-owners. - "+ Create Collection" button hidden entirely for non-owners. - CreateCollectionModal / EditCollectionModal mount only for owners — a non-owner can't reach them via the UI. Note: TASK-1103 spec floated "create gated to editor+", but the server is owner-only. Aligned UI to server (server is the security boundary). Parent: PLAN-1100. --- .../[workspace]/settings/+page.svelte | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/web/src/routes/[username]/[workspace]/settings/+page.svelte b/web/src/routes/[username]/[workspace]/settings/+page.svelte index 94e9b29c..aa584908 100644 --- a/web/src/routes/[username]/[workspace]/settings/+page.svelte +++ b/web/src/routes/[username]/[workspace]/settings/+page.svelte @@ -683,7 +683,7 @@
{#each collections as coll (coll.id)} {@const schema = parseSchema(coll)} - + {/snippet} + + {#if isOwner} + + {:else} +
+ {@render collCardBody()} +
+ {/if} {/each}
{/if} - - (showCreateModal = false)} - /> - {#if editingCollection} + + {#if isOwner} + + (showCreateModal = false)} + /> + {/if} + {#if editingCollection && isOwner}