fix topics.loadMore so it checks read permission

This commit is contained in:
barisusakli
2014-08-05 23:22:21 -04:00
parent 805e6934b9
commit 90ac399f6d
2 changed files with 22 additions and 7 deletions

View File

@@ -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);
});
};