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:
Julian Lam
2019-03-16 14:51:46 -04:00
committed by GitHub
parent c20cd52854
commit 745a9589e9
16 changed files with 20 additions and 20 deletions

View File

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