This commit is contained in:
barisusakli
2015-10-09 17:52:55 -04:00
parent 36bfe30425
commit 7854e67b7b
14 changed files with 350 additions and 182 deletions

View File

@@ -116,19 +116,6 @@ SocketUser.reset.commit = function(socket, data, callback) {
});
};
SocketUser.isAdminOrSelf = function(socket, uid, callback) {
if (socket.uid === parseInt(uid, 10)) {
return callback();
}
user.isAdministrator(socket.uid, function(err, isAdmin) {
if (err || !isAdmin) {
return callback(err || new Error('[[error:no-privileges]]'));
}
callback();
});
};
SocketUser.follow = function(socket, data, callback) {
if (!socket.uid || !data) {
return;
@@ -182,7 +169,7 @@ SocketUser.saveSettings = function(socket, data, callback) {
return callback(new Error('[[error:invalid-data]]'));
}
SocketUser.isAdminOrSelf(socket, data.uid, function(err) {
user.isAdminOrSelf(socket.uid, data.uid, function(err) {
if (err) {
return callback(err);
}