@@ -634,7 +634,7 @@ updateGroupChat :: UserId -> GroupChat -> StaticPQ ()
634634updateGroupChat uId (GroupChat gId (Jsonb perms) name) = commitedTransactionallyUpdate $ do
635635 (GroupChat _ (Jsonb perms') _) <- getGroupChatForUser uId gId
636636 let userPerm = fromMaybe minChatPermissions $ M.lookup uId perms'
637− when (isAdmin userPerm) $
637+ unless (isAdmin userPerm) $
638638 lift $ S.throwError $ S.err401
639639 let newPerms = M.adjust (max userPerm) uId perms
640640 void $ manipulateParams updateGroupChatQ (GroupChat gId (Jsonb newPerms) name)