aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/admin/addmod.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/admin/addmod.js')
-rw-r--r--server/src/commands/admin/addmod.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/commands/admin/addmod.js b/server/src/commands/admin/addmod.js
index 26cec40..e5d8495 100644
--- a/server/src/commands/admin/addmod.js
+++ b/server/src/commands/admin/addmod.js
@@ -2,10 +2,12 @@
Description: Adds the target trip to the mod list then elevates the uType
*/
+import * as UAC from "../utility/UAC/info";
+
// module main
export async function run(core, server, socket, data) {
// increase rate limit chance and ignore if not admin
- if (socket.uType !== 'admin') {
+ if (!UAC.isAdmin(socket.level)) {
return server.police.frisk(socket.address, 20);
}
@@ -18,6 +20,7 @@ export async function run(core, server, socket, data) {
for (let i = 0, l = newMod.length; i < l; i += 1) {
// upgrade privilages
newMod[i].uType = 'mod';
+ newMod[i].level = UAC.levels.moderator;
// inform new mod
server.send({
@@ -37,7 +40,7 @@ export async function run(core, server, socket, data) {
server.broadcast({
cmd: 'info',
text: `Added mod: ${data.trip}`,
- }, { uType: 'mod' });
+ }, { level: UAC.isModerator });
return true;
}