fix: update hasRelation condition to be true if cid is passed in in options

This commit is contained in:
Julian Lam
2024-04-25 11:20:14 -04:00
parent 9829a5300e
commit 6964b1fd56

View File

@@ -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) {