diff --git a/lib/modpanel.js b/lib/modpanel.js index 6337715..862a371 100644 --- a/lib/modpanel.js +++ b/lib/modpanel.js @@ -421,6 +421,11 @@ const handle = async (req, res, url, from, web) => { } // by address: only the address typed, which is written down (once // for each address, though the page asks again every few seconds). + // for the roles that ban addresses (lib/roles.js), not every staff member. + if (!roles.can(mod, "address.ban")) { + reply(403, {error: "Your role cannot do that."}); + return; + } const query = String(url.searchParams.get("q") || "").trim().toLowerCase(); const found = staff.byAddress(query); if (found.error) { @@ -505,6 +510,10 @@ const handle = async (req, res, url, from, web) => { return; case "POST /mod/api/address": { + if (!roles.can(mod, "address.ban")) { + reply(403, {error: "Your role cannot do that."}); + return; + } const ban = bans.addressBans().find(entry => sha256(entry.key).slice(0, 16) === String(body.id)); done(ban && bans.unbanAddress(ban.key, mod.username) ? {ok: "No longer banned."} : {error: "Not banned."}, "address unbanned", "", ban ? ban.reason : ""); return; diff --git a/lib/world.js b/lib/world.js index 795f630..abfee77 100644 --- a/lib/world.js +++ b/lib/world.js @@ -1154,7 +1154,7 @@ const enterRoom = (session, name, base, displayName, shardId, props = {}) => { return; } // moderators (marked so in the admin panel) are let into a full room. - if (room && room.sessions.size >= config.maxUsersPerRoom && !session.account.moderator) { + if (room && room.sessions.size >= config.maxUsersPerRoom && !roles.isActiveStaff(session.account)) { joinFailed(session, "This room is currently full"); return; } diff --git a/public/mod.html b/public/mod.html index 9a2de58..cebcec6 100644 --- a/public/mod.html +++ b/public/mod.html @@ -272,7 +272,7 @@