Allow LNbits admin to edit another user's event #22

Open
opened 2026-05-24 16:49:32 +00:00 by padreug · 0 comments
Owner

Context

The events extension admin index has an All Users' Events card (admin-only) that lists every event across every wallet. Today it's read-only — the admin can see proposed/rejected/canceled events from other organizers but can't act on them beyond the existing approve / reject / cancel controls.

A follow-up to PR #19, which made cross-tenant ownership visible by adding the Owner column.

Ask

Let the LNbits admin edit another user's event from the admin UI:

  • Title, description, banner image
  • Start / end / closing dates
  • Price / currency / capacity
  • Ticket policy flags (allow_fiat, auto_approve, etc.)
  • Status (approved / proposed / rejected / canceled — already partially covered by the existing controls)

Today the PUT /events/{event_id} endpoint is gated on require_admin_key for the event's wallet. An LNbits-level admin holding their own wallet's admin_key can't edit because the event belongs to a different wallet. Either:

  • Loosen the endpoint to accept either the event-owner's admin_key OR an LNbits-level admin token (via check_admin), or
  • Add a sibling admin-only endpoint (PUT /events/admin/{event_id} gated by check_admin) that bypasses the wallet check.

The republish-to-Nostr side already handles "admin reaches into other users' events" — see republish-all — so the precedent exists.

Why

Today an organizer who needs to fix a typo, postpone, or cancel an event must do it themselves. If they're unreachable, the LNbits admin has no recourse besides approving/rejecting the existing record. This blocks normal moderation flows (typo fix, contested cancellation, etc.).

Notes

  • Same wallet/owner check needs to be relaxed for the corresponding webapp activities flow if/when this lands — the useActivityDetail "isMine" gate hides Edit from non-owners. An admin-level "isAdmin" override needs to be threaded through.
  • Audit trail: consider stamping last_edited_by_user_id on admin-edited rows so the event-owner can see "an admin edited this on YYYY-MM-DD" rather than silent override.
## Context The events extension admin index has an **All Users' Events** card (admin-only) that lists every event across every wallet. Today it's read-only — the admin can see proposed/rejected/canceled events from other organizers but can't act on them beyond the existing `approve` / `reject` / `cancel` controls. A follow-up to PR #19, which made cross-tenant ownership visible by adding the `Owner` column. ## Ask Let the LNbits admin **edit** another user's event from the admin UI: - Title, description, banner image - Start / end / closing dates - Price / currency / capacity - Ticket policy flags (`allow_fiat`, `auto_approve`, etc.) - Status (approved / proposed / rejected / canceled — already partially covered by the existing controls) Today the `PUT /events/{event_id}` endpoint is gated on `require_admin_key` for the **event's wallet**. An LNbits-level admin holding their own wallet's admin_key can't edit because the event belongs to a different wallet. Either: - Loosen the endpoint to accept either the event-owner's admin_key OR an LNbits-level admin token (via `check_admin`), or - Add a sibling admin-only endpoint (`PUT /events/admin/{event_id}` gated by `check_admin`) that bypasses the wallet check. The republish-to-Nostr side already handles "admin reaches into other users' events" — see `republish-all` — so the precedent exists. ## Why Today an organizer who needs to fix a typo, postpone, or cancel an event must do it themselves. If they're unreachable, the LNbits admin has no recourse besides approving/rejecting the existing record. This blocks normal moderation flows (typo fix, contested cancellation, etc.). ## Notes - Same wallet/owner check needs to be relaxed for the corresponding webapp activities flow if/when this lands — the `useActivityDetail` "isMine" gate hides Edit from non-owners. An admin-level "isAdmin" override needs to be threaded through. - Audit trail: consider stamping `last_edited_by_user_id` on admin-edited rows so the event-owner can see "an admin edited this on YYYY-MM-DD" rather than silent override.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/events#22
No description provided.