web/docs/design/SYSTEM-BOARDS.md

92 lines
6.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# System Boards
Implementation batch: central access projection, native provisioning, scoped child forum management and shared CP embeds. Written and checked; not live yet.
## Agreed structure
System Boards is one bottom-of-index category, collapsed by default. Clan
Boards, Company Boards and Election Board live beneath it. Clan and company
CPs embed their own organisation board. The menu structure is shared.
Use MyBB's native forum permissions, moderator records and inheritance.
Membership is authoritative in the central organisation records, never in
browser parameters. Revoke stale managed forum groups before content is
served, retaining unrelated political and staff groups. Existing staff retain
global moderation. The Big 4.1 retain inspection rights; inspection itself
does not grant moderation. Clan owners moderate only their own subtree and
can create unlimited nested forums/categories there. No global ACP access.
`website/node/system-board-access.mjs` is the shared server-side projection.
Clan owners must have both current ownership and the owner membership role.
Company access reuses the current founder/CEO registry; scoped management
belongs to the current CEO. Additional company-member roles must use the
actual membership service when it is implemented, rather than fabricated
memberships. Every identity refresh must reload the projection, so leaving,
removal and changes of ownership invalidate old grants.
Public feeds, search, attachments, direct links and main-index counts must
respect private forum permissions. The existing website's public forum-feed
adapter also needs explicit exclusion of private System Boards descendants.
Election topics are discussions of already confirmed candidatures. MyBB does
not create candidatures, cast votes or decide election results. Publish topics
idempotently by application ID; never expose private application records.
## Publication order
1. CI must pass for the exact commit. Keep PR #337 open.
2. Stage the matching native PHP helpers and run lint plus test-system-board-policy.php. No native helper is installed in production yet.
3. Run website/ops/system-board-snapshot.mjs with the existing application environment; pipe its organisation snapshot to provision-system-boards.php as the native application owner. No credentials or private account records are emitted.
4. Run test-system-board-native.php against actual MyBB. It checks guest/nonmember denial, every organisation pair and existing staff using native permission merging, without modifying users.
5. Activate the matching central release with SYSTEM_BOARDS_ENABLED=1, install the helpers and reviewed plugin hook together. Preserve newer unrelated plugin changes; apply the small hook diff rather than overwriting an unverified live plugin.
6. Forum frame-ancestors must include every ancestor: CP, clans, corp and the politics shell (currently www). The present policy lacks clans/corp and needs a scoped update before nested embeds will work.
7. Publish the matching Clan/Company outer shells, then verify real membership revocation, post/reply forms, attachments, search, subtree creation and mobile layout before calling this live.
## Remaining work
- Execute publication and authenticated live verification.
- Add idempotent confirmed-candidature topic publication and lifecycle synchronization. Election Board navigation is provided; automatic candidature topics are not implemented. Applications and ballots remain authoritative in the existing election service.
Ordinary SSH as unimatrix works; sudo -n currently requires interactive authentication. Native publication therefore needs restored privileged access or the server administrator. Uploading approved sources into /tmp is not publication.
## Deleted organisations
On clan deletion, current central membership grants disappear. Preserve forum history and let native MyBB autoprune handle eventual post cleanup. No custom clan/forum deletion or cleanup worker is required (user decision, 16 November 2026).
## Compact internal view
The first board batch is live from main 39bb5486 (PR #351, CI #354); the four existing active clans have private forums. Native MyBB permission merging passed 52 checks. The user has posted a test thread successfully. The following styling batch gives embedded CP pages a separate green/gold dev presentation and shared palace background, small author rows, no public-profile decoration or signatures, and a full-forum link. Category defaults use MyBB’s native collapse cookie once, then respect the user preference. No custom deletion/pruning worker is needed.
## Management page and normal-index control
The management page uses a pure shared PHP view (system-board-manage-view.php) with the compact board stylesheet, illustrated heading, field cards, native field names and CSRF token, and a read-only structure guide. POST validation and inherited membership/moderation remain unchanged. The existing dune_sections.php index renderer replaces MyBB category markup; it now restores the native expander image and cat_<fid>_e container for the System Boards root, respecting native collapse cookies. Other categories keep their previous presentation. The CLI publisher disables front-end plugins during initialization, avoiding duplicate helper loading after installation.
## Automatic registration/first-open repair
The CLI publisher and authenticated MyBB entry point share
`system-board-provision.php`. Central SSO includes current organisation names
alongside the existing membership grants. On first authenticated access, any
missing board for a verified read/post grant is provisioned idempotently before
native group synchronization and redirect. Registration therefore does not
block on a remote MyBB request, and members no longer require a manual forum
publication after creating a clan. The initial rollout publisher also
reconciles every current active clan/company from the central snapshot.
Browser-supplied ids/names cannot create boards. The existing MySQL publication
lock, private permission matrix, leader moderation and global staff moderation
are unchanged. Archived clan cleanup remains a separate native forum concern.
After CI and application promotion, run from the active release:
```sh
sudo python3 /home/dunerealms/apps/dunerealms/current/ops/publish-system-board-repair.py
sudo python3 /home/dunerealms/apps/dunerealms/current/ops/publish-system-board-repair.py --apply
```
The publisher checks active release identity, lints PHP, runs policy tests,
refuses unreviewed native helper changes, backs up only the small overwritten
helpers, installs the shared helper before its callers, reconciles current
boards, and runs native permission tests. It does not overwrite MyBB plugins,
forum content or staff permissions. Native installation requires the existing
server publication privilege; an application CI merge alone does not copy
these files into MyBB.