From 6964b1fd5644b3e6354414a967065b3c9fddfc36 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 25 Apr 2024 11:20:14 -0400 Subject: [PATCH] fix: update hasRelation condition to be true if cid is passed in in options --- src/activitypub/notes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 1c0b859d83..327b51e31e 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -79,7 +79,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => { mainPid = utils.isNumber(mainPid) ? parseInt(mainPid, 10) : mainPid; // Relation & privilege check for local categories - const hasRelation = options.skipChecks || hasTid || await assertRelation(chain[0]); + const hasRelation = options.skipChecks || options.cid || hasTid || await assertRelation(chain[0]); const privilege = `topics:${tid ? 'reply' : 'create'}`; const allowed = await privileges.categories.can(privilege, cid, activitypub._constants.uid); if (!hasRelation || !allowed) {