fix(ui): hide write/edit controls from READ_ALL (read-only) users (#696) #699
@@ -43,6 +43,8 @@ const isAdmin = $derived(
|
||||
data?.user?.groups?.some((g: { permissions: string[] }) => g.permissions.includes('ADMIN'))
|
||||
);
|
||||
|
||||
const canUpload = $derived(Boolean(data?.user && data.canWrite));
|
||||
|
||||
// Set after client-side hydration completes. Used by E2E tests to know the
|
||||
// page is interactive (event handlers registered) before they interact with it.
|
||||
let hydrated = $state(false);
|
||||
@@ -75,7 +77,7 @@ const userInitials = $derived.by(() => {
|
||||
|
||||
<!-- Right Side -->
|
||||
<div class="flex items-center gap-3">
|
||||
{#if data?.user && data.canWrite}
|
||||
{#if canUpload}
|
||||
<a
|
||||
href="/documents/new"
|
||||
aria-label={m.upload_action()}
|
||||
|
||||
Reference in New Issue
Block a user