check if we have edit permission on the pids that we want to move

This commit is contained in:
Baris Soner Usakli
2014-01-06 19:20:01 -05:00
parent 291aa872c4
commit faf5ea2122
2 changed files with 15 additions and 10 deletions

View File

@@ -27,7 +27,7 @@ var winston = require('winston'),
}
PostTools.privileges = function(pid, uid, callback) {
if(uid == 0) {
if(parseInt(uid, 10) === 0) {
callback({
editable: false,
view_deleted: false
@@ -52,7 +52,9 @@ var winston = require('winston'),
return next(null, false);
} else {
user.getUserField(uid, 'reputation', function(err, reputation) {
if (err) return next(null, false);
if (err) {
return next(null, false);
}
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_content'], 10));
});
}