Skip to content

Node.js based forum software built for the modern web

ability to disable privilege threshold system, closes #528

psychobunnyd5e8044575af
diff --git a/src/postTools.js b/src/postTools.js
index e31fa70552..7fcd9fe464 100644
--- a/src/postTools.js
+++ b/src/postTools.js
@@ -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) {
diff --git a/src/threadTools.js b/src/threadTools.js
index ed32f795be..5566b8fc9a 100644
--- a/src/threadTools.js
+++ b/src/threadTools.js
@@ -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 : {