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