Skip to content

feat(editor): enforce per-map permissions and audit every map edit - #381

Open
alidonghao118-commits wants to merge 11 commits into
Bitcoindefi:mainfrom
alidonghao118-commits:fix/map-edit-permissions-4
Open

alidonghao118-commits wants to merge 11 commits into
Bitcoindefi:mainfrom
alidonghao118-commits:fix/map-edit-permissions-4

Conversation

@alidonghao118-commits

@alidonghao118-commits alidonghao118-commits commented Sep 19, 2026

Copy link
Copy Markdown

Closes #4

Map editing now checks the authenticated account against a grant for the requested map. Protected maps (map 1 by default) require a global administrator plus an explicit override, passed through the Next proxy and selected in the editor. Collaborators can open their assigned maps and read the object/NPC catalogs; global definition edits and graphic uploads remain admin-only.

Every map mutation records the actor, map, action and time, including clearTile. SQL edits commit their audit record in the same transaction. File-backed NPC edits first record a durable intent with before/after snapshots, replace the file, then mark the outcome. api/MAP_EDITING.md documents grants, configuration and recovery of pending file edits; filesystem and database writes are not an atomic transaction.

Validation on Windows with PostgreSQL 18.6:

  • API: typecheck and all 106 tests passed, including 11 real HTTP/PostgreSQL integration tests. TypeScript emit and packaging of the checked-out assets passed.
  • Regression verification: restoring the old server makes the scoped-grant and protected-map tests fail; restoring the old proxy makes the explicit-override test fail.
  • Frontend: typecheck, lint and production build passed. Two existing lint warnings remain in BuffStatusSidebar.tsx. A provider diagnostic also checked stale map responses and override reset.
  • Shared protocol: typecheck, 34 tests and build passed. Game server: typecheck, lint, 3 tests and build passed.
  • Browser checks with real Next/API/PostgreSQL and synthetic map assets: protected-map opt-in and reset, pending paint saved to its original map during switching, scoped collaborator paint/publish with database actor attribution, and editor access denied to an unassigned account.
  • Browser testing exposed a confirmation dialog hidden beneath the canvas. It now renders through a portal; actual publishing and its audit record were rechecked. Frontend typecheck, targeted lint and production build passed after this fix. The build used its existing fallback when the ranking service was unavailable.
  • Fetched the uploaded branch back and verified its complete tree matches the local implementation (98c5320).

Ready for review. Repository workflows still need maintainer approval. Docker is unavailable on this Windows host; the sparse-checkout API asset packaging check does not replace full CI. Please enable the pending workflows for this branch.

@gitar-bot

gitar-bot Bot commented Sep 19, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

@alidonghao118-commits

Copy link
Copy Markdown
Author

Ya pude entrar a GrantFox. El issue aparece asignado a mi usuario, pero no veo el botón para postularme y Third Campaign figura inactiva desde el 31 de agosto. ¿Cómo registro esta entrega para el pago de los $50?

https://contribute.grantfox.xyz/org/Bitcoindefi/repo/OpenAO/issue/4

@alidonghao118-commits
alidonghao118-commits marked this pull request as ready for review September 19, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Etapa 0: permisos y atribucion para edicion de mapas

1 participant