mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-11 02:50:29 +00:00
✨ Add restore_point functionality to Meetups
- 💾 Introduced `restore_point` JSON column in `meetups` table for saving and restoring master data. - 🛠️ Added methods `captureRestorePoint` and `restoreFromRestorePoint` to `Meetup` model for managing restore points. - 🔒 Implemented authorization for updating meetups via `updateViaPortal` policy to include pivot members. - 🔗 Created Artisan commands `meetups:snapshot` and `meetups:restore` for managing restore points from CLI. - 🚦 Added rate limiter to restrict excessive update attempts in Livewire meetup editing. - ✅ Developed exhaustive feature tests for snapshot and restore actions, portal editing rules, and rate limiting.
This commit is contained in:
@@ -58,6 +58,18 @@ it('forbids updating someone elses', function () {
|
||||
])->assertForbidden();
|
||||
});
|
||||
|
||||
it('forbids updating as a pivot member who is not the creator', function () {
|
||||
$owner = User::factory()->create();
|
||||
$meetup = Meetup::factory()->create(['created_by' => $owner->id]);
|
||||
|
||||
Sanctum::actingAs($member = User::factory()->create());
|
||||
$meetup->users()->attach($member);
|
||||
|
||||
$this->patchJson('/api/meetup/'.$meetup->id, [
|
||||
'name' => 'Plan B Lugano',
|
||||
])->assertForbidden();
|
||||
});
|
||||
|
||||
it('returns only own in mine index', function () {
|
||||
Sanctum::actingAs($user = User::factory()->create());
|
||||
$other = User::factory()->create();
|
||||
|
||||
Reference in New Issue
Block a user