feat(roles): masterpieces.approve, its own permission

Approving and removing framed paintings was items.approve, which also
judges the items and pictures players make. masterpieces.approve now
guards it, on the server (POST /mod/api/masterpiece) and in the mod
panel's buttons and its "only ones I approved" filter. Moderators and
admins have it by default; seeing the Masterpieces page is still
player.view.

roles.load, once at start (setting permissionSplitMasterpieces): a role
list the admin changed, and a staff member's own grants and denies, that
held items.approve are given masterpieces.approve too, so nobody gains or
loses anything by the split.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
BurrowdevandClaude Opus 5.5 committed 2026-10-21 20:50:44 +03:00
1 parent 9720d309fa
commit 9efb2558fc
4 files changed
+41 -8

No files matched your search

+3 -3
View File
@@ -2057,8 +2057,8 @@
// card, their name opens it)
const paintingButtons = (painting, withPlayer) => {
const buttons = el("div", undefined, "buttons");
// judging paintings is for the roles that judge what players make
if (permissions.has("items.approve")) {
// judging paintings is for the roles that may (masterpieces.approve)
if (permissions.has("masterpieces.approve")) {
buttons.append(...(painting.status === "waiting" ? [button("Approve", () => judge(painting, true), "primary")] : []),
button("Reject", () => judge(painting, false), "danger"));
}
@@ -3136,7 +3136,7 @@
sub.hidden = !allowed.has(sub.dataset.needs);
}
// a role that does not judge paintings has approved none of them
$("recent-mine").closest("label").hidden = !allowed.has("items.approve");
$("recent-mine").closest("label").hidden = !allowed.has("masterpieces.approve");
// the pages the role may see; the first of them when the one open is not.
const pages = [...document.querySelectorAll("nav button")];
for (const page of pages) {