ability to disable privilege threshold system, closes #528

v1.18.x
psychobunny 11 years ago
parent c0721e105f
commit d5e8044575

@ -48,10 +48,14 @@ var db = require('./database'),
}
function hasEnoughRep(next) {
user.getUserField(uid, 'reputation', function(err, reputation) {
if (err) return next(null, false);
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_content'], 10));
});
if (meta.config['privileges:disabled']) {
return next(null, false);
} else {
user.getUserField(uid, 'reputation', function(err, reputation) {
if (err) return next(null, false);
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_content'], 10));
});
}
}
async.parallel([getThreadPrivileges, isOwnPost, hasEnoughRep], function(err, results) {

@ -33,10 +33,14 @@ var db = require('./database'),
});
},
hasEnoughRep: function(next) {
user.getUserField(uid, 'reputation', function(err, reputation) {
if (err) return next(null, false);
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_topic'], 10));
});
if (meta.config['privileges:disabled']) {
return next(null, false);
} else {
user.getUserField(uid, 'reputation', function(err, reputation) {
if (err) return next(null, false);
next(null, parseInt(reputation, 10) >= parseInt(meta.config['privileges:manage_topic'], 10));
});
}
}
}, function(err, results) {
callback(err, !results ? undefined : {

Loading…
Cancel
Save