Add guest policy settings
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-01 20:25:39 +01:00
parent 25d464215e
commit c180b37760
15 changed files with 500 additions and 19 deletions

View File

@@ -4,6 +4,7 @@ namespace Tests\Feature;
use App\Models\Event;
use App\Models\EventPackage;
use App\Models\GuestPolicySetting;
use App\Models\MediaStorageTarget;
use App\Models\Package;
use App\Models\Photo;
@@ -206,6 +207,25 @@ class GuestJoinTokenFlowTest extends TestCase
->assertJsonPath('error.code', 'invalid_token');
}
public function test_gallery_defaults_use_guest_policy_settings(): void
{
GuestPolicySetting::flushCache();
GuestPolicySetting::query()->create([
'id' => 1,
'guest_downloads_enabled' => false,
'guest_sharing_enabled' => false,
]);
$event = $this->createPublishedEvent();
$token = $this->tokenService->createToken($event);
$response = $this->getJson("/api/v1/gallery/{$token->token}");
$response->assertOk()
->assertJsonPath('event.guest_downloads_enabled', false)
->assertJsonPath('event.guest_sharing_enabled', false);
}
public function test_guest_cannot_access_event_with_revoked_token(): void
{
$event = $this->createPublishedEvent();