ability to disable privilege threshold system, closes #528

This commit is contained in:
psychobunny
2013-12-08 10:49:42 -05:00
parent c0721e105f
commit d5e8044575
2 changed files with 16 additions and 8 deletions

View File

@@ -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 : {