mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
closes #3120
also dont allow loading posts of a topic if its deleted via topics.loadMore
This commit is contained in:
@@ -448,13 +448,16 @@ SocketTopics.loadMore = function(socket, data, callback) {
|
||||
},
|
||||
postCount: function(next) {
|
||||
topics.getPostCount(data.tid, next);
|
||||
},
|
||||
topic: function(next) {
|
||||
topics.getTopicFields(data.tid, ['deleted'], next);
|
||||
}
|
||||
}, function(err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (!results.privileges.read) {
|
||||
if (!results.privileges.read || (parseInt(results.topic.deleted, 10) && !results.privileges.view_deleted)) {
|
||||
return callback(new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user