fix: Comment resolution control visible to non-editors

This commit is contained in:
Tom Moor
2024-07-02 07:52:21 -04:00
parent 117c4f5009
commit f9dadf5548
3 changed files with 10 additions and 10 deletions

View File

@@ -46,7 +46,9 @@ export const resolveCommentFactory = ({
analyticsName: "Resolve thread",
section: DocumentSection,
icon: <DoneIcon outline />,
visible: () => stores.policies.abilities(comment.id).resolve,
visible: () =>
stores.policies.abilities(comment.id).resolve &&
stores.policies.abilities(comment.documentId).update,
perform: async ({ t }) => {
await comment.resolve();
@@ -72,7 +74,9 @@ export const unresolveCommentFactory = ({
analyticsName: "Unresolve thread",
section: DocumentSection,
icon: <DoneIcon outline />,
visible: () => stores.policies.abilities(comment.id).unresolve,
visible: () =>
stores.policies.abilities(comment.id).unresolve &&
stores.policies.abilities(comment.documentId).update,
perform: async () => {
await comment.unresolve();