mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
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:
1 parent
f3983fcf67
commit
ceda20ffc8
4 files changed
+20
-2
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user