mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 16:41:21 +01:00
fix: update hasRelation condition to be true if cid is passed in in options
This commit is contained in:
@@ -79,7 +79,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
mainPid = utils.isNumber(mainPid) ? parseInt(mainPid, 10) : mainPid;
|
mainPid = utils.isNumber(mainPid) ? parseInt(mainPid, 10) : mainPid;
|
||||||
|
|
||||||
// Relation & privilege check for local categories
|
// 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 privilege = `topics:${tid ? 'reply' : 'create'}`;
|
||||||
const allowed = await privileges.categories.can(privilege, cid, activitypub._constants.uid);
|
const allowed = await privileges.categories.can(privilege, cid, activitypub._constants.uid);
|
||||||
if (!hasRelation || !allowed) {
|
if (!hasRelation || !allowed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user