mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +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:
@@ -75,7 +75,7 @@ function postReply(socket, data, callback) {
|
||||
SocketPosts.getRawPost = function (socket, pid, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
privileges.posts.can('read', pid, socket.uid, next);
|
||||
privileges.posts.can('topics:read', pid, socket.uid, next);
|
||||
},
|
||||
function (canRead, next) {
|
||||
if (!canRead) {
|
||||
@@ -112,7 +112,7 @@ SocketPosts.getTimestampByIndex = function (socket, data, callback) {
|
||||
if (!pid) {
|
||||
return callback(null, 0);
|
||||
}
|
||||
privileges.posts.can('read', pid, socket.uid, next);
|
||||
privileges.posts.can('topics:read', pid, socket.uid, next);
|
||||
},
|
||||
function (canRead, next) {
|
||||
if (!canRead) {
|
||||
|
||||
Reference in New Issue
Block a user