From 6e32ec27b4ac1fc07f513f94089a0e0cedf31454 Mon Sep 17 00:00:00 2001 From: Miran Date: Mon, 24 Aug 2020 13:48:23 +0200 Subject: [PATCH] moderators should be able to edit categories (#255) --- src/forum.nim | 2 +- src/frontend/user.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/forum.nim b/src/forum.nim index a880610..563db57 100644 --- a/src/forum.nim +++ b/src/forum.nim @@ -532,7 +532,7 @@ proc updateThread(c: TForumData, threadId: string, queryKeys: seq[string], query let threadAuthor = selectThreadAuthor(threadId.parseInt) # Verify that the current user has permissions to edit the specified thread. - let canEdit = c.rank == Admin or c.userid == threadAuthor.name + let canEdit = c.rank in {Admin, Moderator} or c.userid == threadAuthor.name if not canEdit: raise newForumError("You cannot edit this thread") diff --git a/src/frontend/user.nim b/src/frontend/user.nim index fe4efa7..4428aa4 100644 --- a/src/frontend/user.nim +++ b/src/frontend/user.nim @@ -75,4 +75,4 @@ when defined(js): title="User is a moderator") of Admin: italic(class="fas fa-chess-knight", - title="User is an admin") \ No newline at end of file + title="User is an admin")