mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
added new user method isPrivilegedOrSelf
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user