mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: bug that caused remote replies to other remote content to not always assert
This commit is contained in:
@@ -102,7 +102,11 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
||||
mainPid = utils.isNumber(mainPid) ? parseInt(mainPid, 10) : mainPid;
|
||||
|
||||
// Relation & privilege check for local categories
|
||||
const hasRelation = uid || options.skipChecks || options.cid || hasTid || await assertRelation(chain[0]);
|
||||
const inputIndex = chain.map(n => n.pid).indexOf(id);
|
||||
const hasRelation =
|
||||
uid || hasTid ||
|
||||
options.skipChecks || options.cid ||
|
||||
await assertRelation(chain[inputIndex || 0]);
|
||||
const privilege = `topics:${tid ? 'reply' : 'create'}`;
|
||||
const allowed = await privileges.categories.can(privilege, cid, activitypub._constants.uid);
|
||||
if (!hasRelation || !allowed) {
|
||||
|
||||
Reference in New Issue
Block a user