mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
Let global mods change user avatar
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = function (SocketUser) {
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
user.isAdminOrSelf(socket.uid, data.uid, next);
|
||||
user.isAdminOrGlobalModOrSelf(socket.uid, data.uid, next);
|
||||
},
|
||||
function (next) {
|
||||
switch(type) {
|
||||
|
||||
12
src/user.js
12
src/user.js
@@ -277,6 +277,18 @@ var meta = require('./meta');
|
||||
});
|
||||
};
|
||||
|
||||
User.isAdminOrGlobalModOrSelf = function (callerUid, uid, callback) {
|
||||
if (parseInt(callerUid, 10) === parseInt(uid, 10)) {
|
||||
return callback();
|
||||
}
|
||||
User.isAdminOrGlobalMod(callerUid, function (err, isAdminOrGlobalMod) {
|
||||
if (err || !isAdminOrGlobalMod) {
|
||||
return callback(err || new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
User.getAdminsandGlobalMods = function (callback) {
|
||||
async.parallel({
|
||||
admins: async.apply(groups.getMembers, 'administrators', 0, -1),
|
||||
|
||||
Reference in New Issue
Block a user