Staff roles for the 17 October panel: address search, full rooms

- searching players by address and lifting an address ban need
  address.ban (moderators and above), not only the panel itself
- entering a full room goes by the staff role

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
SnipzilandClaude Opus 5.5 committed 2026-10-16 22:50:47 -04:00
1 parent f3983fcf67
commit ceda20ffc8
4 files changed
+20 -2

No files matched your search

+9
View File
@@ -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;
+1 -1
View File
@@ -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;
}