Node.js based forum software built for the modern web
added new user method isPrivilegedOrSelf
Julian Lam1f10549cf5e1
diff --git a/src/user.js b/src/user.jsindex 2ad441c5ce..6661dca8a7 100644--- a/src/user.js+++ b/src/user.js@@ -239,6 +239,10 @@ User.isAdminOrGlobalModOrSelf = function (callerUid, uid, callback) {isSelfOrMethod(callerUid, uid, User.isAdminOrGlobalMod, callback);};+User.isPrivilegedOrSelf = function (callerUid, uid, callback) {+ isSelfOrMethod(callerUid, uid, User.isPrivileged, callback);+};+function isSelfOrMethod(callerUid, uid, method, callback) {if (parseInt(callerUid, 10) === parseInt(uid, 10)) {return callback();