mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 10:46:14 +01:00
Use topics:read privilege for topic filtering use cases (#7462)
* fix: use topics:read privilege for topic filtering use cases * fix: tests * fix: more broken tests
This commit is contained in:
@@ -21,7 +21,7 @@ module.exports = function (Categories) {
|
||||
db.getSortedSetRevRange('cid:' + cid + ':pids', 0, count - 1, next);
|
||||
},
|
||||
function (pids, next) {
|
||||
privileges.posts.filter('read', pids, uid, next);
|
||||
privileges.posts.filter('topics:read', pids, uid, next);
|
||||
},
|
||||
function (pids, next) {
|
||||
posts.getPostSummaryByPids(pids, uid, { stripTags: true }, next);
|
||||
@@ -92,7 +92,7 @@ module.exports = function (Categories) {
|
||||
function (results, next) {
|
||||
var tids = _.uniq(_.flatten(results).filter(Boolean));
|
||||
|
||||
privileges.topics.filterTids('read', tids, uid, next);
|
||||
privileges.topics.filterTids('topics:read', tids, uid, next);
|
||||
},
|
||||
function (tids, next) {
|
||||
getTopics(tids, uid, next);
|
||||
|
||||
Reference in New Issue
Block a user