diff --git a/lib/modpanel.js b/lib/modpanel.js index ffd9ea8..fd6bb26 100644 --- a/lib/modpanel.js +++ b/lib/modpanel.js @@ -670,6 +670,17 @@ const handle = async (req, res, url, from, web) => { return; } + // the mod log (lib/modlog.js): what staff did, as the admin panel's + // Moderators page shows it. + if (route === "GET /mod/api/modlog") { + if (!roles.can(mod, "staff.log")) { + reply(403, {error: "Your role does not allow that."}); + return; + } + reply(200, {log: modlog.recent()}); + return; + } + // everything else shows players and what they did: not for a role that // only makes things. if (!roles.can(mod, "player.view")) { diff --git a/lib/roles.js b/lib/roles.js index 87045f7..ac33c27 100644 --- a/lib/roles.js +++ b/lib/roles.js @@ -33,10 +33,11 @@ const PERMISSIONS = { "room.effects": "run temporary room-wide size and colour effects (!roomfx)", "theater.control": "play or stop a YouTube video for everyone in the theatre", "music.upload": "upload MP3s as den music tracks, and delete those uploaded (the Music page)", + "staff.log": "read the mod log: what staff did, in the panels and the game (the Mod log page)", }; const HELPER = ["server.view", "player.view", "staff.list", "player.warn", "player.goto", "chat.silence"]; -const MODERATOR = [...HELPER, "player.kick", "player.summon", "staff.invisible", "player.ban", "player.names", "address.ban", "items.approve", "items.restrict", "theater.control"]; +const MODERATOR = [...HELPER, "player.kick", "player.summon", "staff.invisible", "player.ban", "player.names", "address.ban", "items.approve", "items.restrict", "theater.control", "staff.log"]; const ADMIN = [...MODERATOR, "items.create", "room.effects", "music.upload"]; // a developer makes things, and moderates nobody. const DEVELOPER = ["server.view", "staff.list", "items.create", "room.effects", "theater.control"]; diff --git a/public/mod.html b/public/mod.html index b474f0f..ef93b98 100644 --- a/public/mod.html +++ b/public/mod.html @@ -475,6 +475,7 @@ + @@ -992,6 +993,17 @@ +
| When | Who | What | Player | Detail |
|---|