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([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
user.isAdminOrSelf(socket.uid, data.uid, next);
|
user.isAdminOrGlobalModOrSelf(socket.uid, data.uid, next);
|
||||||
},
|
},
|
||||||
function (next) {
|
function (next) {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
|||||||
12
src/user.js
12
src/user.js
@@ -276,6 +276,18 @@ var meta = require('./meta');
|
|||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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) {
|
User.getAdminsandGlobalMods = function (callback) {
|
||||||
async.parallel({
|
async.parallel({
|
||||||
|
|||||||
Reference in New Issue
Block a user