mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
ability to disable privilege threshold system, closes #528
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user