Paradaux
0

A way for staff/DOC to force disband businesses/change other details in game

Admin commands for staff/DOC to manage businesses in-game: /firm admin disband, /firm admin rename, /firm admin set attribute, /firm admin set proprietor.

Technical notes — No business.admin.* firm command surface exists (only business.admin.reload). Service methods present: disbandFirm (proprietor-gated), updateProprietor(firmId, playerId) (internal, ungated), updateFirmHq/Discord (ADMIN-gated). Missing: renameFirmMapper has create/update/archive but no name-change method. Add a FirmCommands @Route("admin …") group gated on a new business.admin.* perm that bypasses proprietor checks; reuse disbandFirm/updateProprietor, add a new renameFirm routed through NameValidator + uniqueness (like createFirm).

Comments

tesks · Jun 4, 2026, 9:56 AM

Code context — No business.admin.* firm command surface exists (only business.admin.reload). Service methods present: disbandFirm (proprietor-gated), updateProprietor(firmId, playerId) (internal, ungated — callers must gate), updateFirmHq/Discord (ADMIN-gated). Missing: renameFirmMapper has create/update/archive but no name-change method.

Approach: add a FirmCommands @Route("admin disband|rename|set proprietor …") group gated on a new business.admin.* perm that bypasses the proprietor checks; reuse disbandFirm/updateProprietor, and add a new renameFirm service+mapper method routed through NameValidator + a uniqueness check (mirroring createFirm).

technofied · Jun 4, 2026, 12:53 PM

Would be nice if we could rename firms with this one?

tesks · Jun 5, 2026, 7:38 AM

Implemented on develop (commit 7d7f8ed).

New /firm admin … command group, each route gated on a business.admin.* node (not registered in plugin.yml, like the rest of the fine-grained nodes — grant via LuckPerms). All bypass proprietor/firm-role checks:

CommandPermission
admin disband <firm>business.admin.disband
admin rename <firm> <newname>business.admin.rename
admin set hq <firm> <plot>business.admin.attribute
admin set discord <firm> <url>business.admin.attribute
admin set proprietor <firm> <player>business.admin.proprietor

Service layer

  • Force-disband reuses the real disband mechanics — extracted disbandInternal(firm) (drains balances to the proprietor + archives) so the proprietor-gated and admin paths share it; admin path skips only the isProprietor check. Idempotent (already-disbanded → rejected).
  • rename is the genuinely new piece (FirmMapper had no name-change). renameFirm validates via the same rules as creation — extracted validateFirmName(...) shared with createFirm — and rejects collisions with a different firm (self-rename / case-change is allowed). Persists through updateFirm's existing conditional display_name set.
  • set hq/discord/proprietor reuse the ungated mutators.

The admin firm arg tab-completes from firms with someone online (OnlineFirmName) but resolves any firm by name/id. <newname> is a single token, consistent with create.

Tests: 13 new cases in FirmServiceImplTest (admin disband bypass + guards, rename success/unknown/invalid/duplicate/self-rename, set hq/discord/proprietor, unknown-firm guard). Coverage gate (≥95%) green.

Bonus: dropped the stale "ampersand" wording from the firm-name validation message (PAR-53 removed & from the validator).

Activity

  • ParadauxIO linked a commit — Commit 7d7f8ed — Add staff/DOC firm administration commands (PAR-11)Jun 7, 2026, 2:49 PM
  • ParadauxIO changed status to Status → DoneJun 7, 2026, 2:49 PM
  • ParadauxIO linked a pull request — PR #6 merged — Release: develop → mainJun 7, 2026, 2:49 PM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 7, 2026, 12:36 AM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 11:49 PM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 12:44 PM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 11:17 AM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 11:11 AM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 5, 2026, 12:35 PM
  • tesks commentedJun 5, 2026, 7:38 AM
  • tesks changed status to Status → Pending ReleaseJun 5, 2026, 7:38 AM
  • ParadauxIO linked a commit — Commit 7d7f8ed — Add staff/DOC firm administration commands (PAR-11)Jun 5, 2026, 7:38 AM
  • tesks changed status to Status → In ProgressJun 5, 2026, 7:34 AM
  • technofied commentedJun 4, 2026, 12:53 PM
  • tesks description: Description updatedJun 4, 2026, 10:01 AM
  • tesks commentedJun 4, 2026, 9:56 AM
  • tesks assigned Assigned to rianJun 4, 2026, 9:27 AM