PAR-237 · Grant secretaries access to view department account… · Paradaux · taskl.ie
PAR-237
Grant secretaries access to view department account transactions
Enable secretaries to view the transactions for their respective Department accounts without exposing all trade-by-trade logs. This change is aimed at improving transparency and access for department leadership.
Activity
Ttesks created the issue
Ttesks set status to In Progress ·Jun 21
PParadauxIO linked a commit: Commit bf1c1d3 — Add a read-only viewer tier for government accounts (PAR-237, part 1: in-game) ·Jun 21
PParadauxIO linked a commit: Commit 5a0f25b — Show a department secretary their account's history on the explorer (PAR-237, part 2) ·Jun 21
T
tesksJun 21
Done — read-only "viewer" tier for government accounts (both phases green on CI)
Model decision: members can already view a department's ledger history (which is summary-level, never trade-by-trade), but membership also grants spending — so there was no view-only tier. Added a third, lowest tier — viewer — scoped per-department, mirroring the member/group-member model.
Part 1 — Treasury plugin (commit bf1c1d3)
V18 migration:account_viewers (direct UUID) + account_group_viewers (LuckPerms group), soft-deleted, standalone (no member-FK like authorizers).
MembershipService.isViewer + canView (member OR viewer; no spend/manage) + viewer CRUD; mapper SQL for both.
GovCommand: /government account balance + history now gate on canView (admin, member, or viewer); new /government account viewer add|remove|addgroup|removegroup|list, gated like member management (authorizer + treasury.gov.account.manage).
plugin.yml + messages updated; the admin guide documents the three tiers.
Tests: unit covers the new service methods (incl. the LuckPerms group path); IT validates the SQL end-to-end (a viewer reads but is neither member nor authorizer). 95% coverage gate passes.
Part 2 — Economy Explorer (commit 5a0f25b)
The account-detail page gated history on staff/owner/firm-finance only — so even a government-account member couldn't see it on the web. Added canReadAccount(accountId, uuid) (active member/authorizer/viewer) into the page's canSeeHistory, scoped to the specific account.
The page renders only ledger postings — the per-trade chestshop_sale breakdown lives on the market pages, never here — so "ledger summaries, not trade-by-trade" holds on the web too.
Integration test asserts a viewer sees their department's account, not an unrelated one, and a stranger is denied.
How ops grant a secretary
In-game: /government account viewer add <Dept> <player> (or addgroup <Dept> <lp-group>). Web history access is by UUID viewer/member/authorizer (LuckPerms-group grants resolve in-game only, since the explorer has no live LuckPerms).
Verified locally and on CI: Treasury Test & Coverage + Economy Explorer CI both green on 5a0f25b.
Ttesks set status to Pending Release ·Jun 21
PParadauxIO linked a commit: Commit 0961a98 — Consolidate account members/authorizers/viewers into one account_access table (PAR-249) ·Jun 21
Workspace permission required to comment
Comments and reactions require workspace permission. Ask a workspace owner or admin for access. You can sign in to vote.
Done — read-only "viewer" tier for government accounts (both phases green on CI)
Model decision: members can already view a department's ledger history (which is summary-level, never trade-by-trade), but membership also grants spending — so there was no view-only tier. Added a third, lowest tier — viewer — scoped per-department, mirroring the member/group-member model.
Part 1 — Treasury plugin (commit
bf1c1d3)account_viewers(direct UUID) +account_group_viewers(LuckPerms group), soft-deleted, standalone (no member-FK like authorizers).MembershipService.isViewer+canView(member OR viewer; no spend/manage) + viewer CRUD; mapper SQL for both.GovCommand:/government account balance+historynow gate oncanView(admin, member, or viewer); new/government account viewer add|remove|addgroup|removegroup|list, gated like member management (authorizer +treasury.gov.account.manage).Part 2 — Economy Explorer (commit
5a0f25b)canReadAccount(accountId, uuid)(active member/authorizer/viewer) into the page'scanSeeHistory, scoped to the specific account.chestshop_salebreakdown lives on the market pages, never here — so "ledger summaries, not trade-by-trade" holds on the web too.How ops grant a secretary
In-game:
/government account viewer add <Dept> <player>(oraddgroup <Dept> <lp-group>). Web history access is by UUID viewer/member/authorizer (LuckPerms-group grants resolve in-game only, since the explorer has no live LuckPerms).Verified locally and on CI: Treasury Test & Coverage + Economy Explorer CI both green on
5a0f25b.