mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
fix topics.loadMore so it checks read permission
This commit is contained in:
@@ -413,8 +413,12 @@ var async = require('async'),
|
||||
};
|
||||
|
||||
Topics.isOwner = function(tid, uid, callback) {
|
||||
uid = parseInt(uid, 10);
|
||||
if (uid === 0) {
|
||||
return callback(null, false);
|
||||
}
|
||||
Topics.getTopicField(tid, 'uid', function(err, author) {
|
||||
callback(err, parseInt(author, 10) === parseInt(uid, 10));
|
||||
callback(err, parseInt(author, 10) === uid);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user