fix(categories): address PR #790 review — event ownership, migration renumber, nits

- 🔴 Event ownership: GET /event/:eventId and DELETE /reorder/:eventId now use
  requireEventOwnership; POST /reorder (event_id in body) gets the equivalent
  inline check (super_admin bypasses; others limited to owned/ownerless events).
  New test covers a settings.edit-holding non-super_admin blocked (403) on all
  three per-event routes.
- 🔴 Migration renumber: 158→159, 159→160 (upstream #788 already took 158);
  headers + the test's require path updated.
- 🟢 Nits: stale inline "Drag the arrows" fallback → "Use the arrows" (matches
  en.json; control is click-only); invalid bg-accent-dark/150 → bg-accent-dark.
This commit is contained in:
Luca
2026-07-10 20:10:40 +02:00
parent 8d0a946478
commit a4b4485d32
6 changed files with 68 additions and 12 deletions
@@ -177,7 +177,7 @@ export const EventCategoryManager: React.FC<EventCategoryManagerProps> = ({ even
<p className="text-xs text-neutral-500 dark:text-neutral-400 italic">
{isCustomised
? t('categories.orderCustomisedHint', 'This gallery uses a custom order. Reset to follow the global default (Settings → Photo Categories).')
: t('categories.orderDefaultHint', 'Drag the arrows to set the order for this gallery. Otherwise it follows the global default (Settings → Photo Categories).')}
: t('categories.orderDefaultHint', 'Use the arrows to set the order for this gallery. Otherwise it follows the global default (Settings → Photo Categories).')}
</p>
{/* Add new category form */}
@@ -378,7 +378,7 @@ export const EventCategoryManager: React.FC<EventCategoryManagerProps> = ({ even
/>
</div>
{isSelected && (
<div className="absolute top-2 right-2 bg-accent-dark/150 text-white rounded-full p-1">
<div className="absolute top-2 right-2 bg-accent-dark text-white rounded-full p-1">
<Check className="w-4 h-4" />
</div>
)}