missed a bunch of "editable" checks

v1.18.x
Julian Lam 11 years ago
parent ac65655384
commit 34b522f36d

@ -121,7 +121,7 @@ var winston = require('winston'),
}
PostTools.privileges(pid, uid, function(err, privileges) {
if (err || !privileges.editable) {
if (err || !privileges.meta.editable) {
return callback(err || new Error('[[error:no-privileges]]'));
}
@ -164,7 +164,7 @@ var winston = require('winston'),
PostTools.privileges(pid, uid, next);
},
function(privileges, next) {
if (!privileges || !privileges.editable) {
if (!privileges || !privileges.meta.editable) {
return next(new Error('[[error:no-privileges]]'));
}
next();

@ -186,7 +186,7 @@ function doTopicAction(action, socket, tids, callback) {
return next(err);
}
if(!privileges || !privileges.editable) {
if(!privileges || !privileges.meta.editable) {
return next(new Error('[[error:no-privileges]]'));
}

@ -291,7 +291,7 @@ var async = require('async'),
topicData.thread_tools = results.threadTools;
topicData.pageCount = results.pageCount;
topicData.unreplied = parseInt(topicData.postcount, 10) === 1;
topicData.expose_tools = results.privileges.editable ? 1 : 0;
topicData.expose_tools = results.privileges.meta.editable ? 1 : 0;
callback(null, topicData);
});

@ -57,7 +57,7 @@ module.exports = function(Topics) {
return next(err);
}
if(privileges.editable) {
if(privileges.meta.editable) {
Topics.movePostToTopic(pid, tid, next);
} else {
next();

@ -66,7 +66,7 @@ module.exports = function(Topics) {
postData[i].upvoted = results.voteData[i].upvoted;
postData[i].downvoted = results.voteData[i].downvoted;
postData[i].votes = postData[i].votes || 0;
postData[i].display_moderator_tools = parseInt(uid, 10) !== 0 && results.privileges[i].editable;
postData[i].display_moderator_tools = parseInt(uid, 10) !== 0 && results.privileges[i].meta.editable;
postData[i].display_move_tools = results.privileges[i].move;
postData[i].selfPost = parseInt(uid, 10) === parseInt(postData[i].uid, 10);

Loading…
Cancel
Save