write access fix
This commit is contained in:
@@ -159,7 +159,8 @@ export const NotepadView: Component<{
|
|||||||
</div>
|
</div>
|
||||||
}>
|
}>
|
||||||
{(note) => {
|
{(note) => {
|
||||||
const canEdit = note().user === currentUserId;
|
const isOwner = note().user === currentUserId;
|
||||||
|
const canEdit = isOwner || !note().isPrivate;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -186,7 +187,7 @@ export const NotepadView: Component<{
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div class="flex items-center gap-2 shrink-0 pt-1">
|
<div class="flex items-center gap-2 shrink-0 pt-1">
|
||||||
<Show when={canEdit}>
|
<Show when={isOwner}>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -199,7 +200,7 @@ export const NotepadView: Component<{
|
|||||||
</Button>
|
</Button>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<Show when={canEdit}>
|
<Show when={isOwner}>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
|
|||||||
Reference in New Issue
Block a user