Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
19
app/Policies/CateringPolicy.php
Executable file
19
app/Policies/CateringPolicy.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\EventCatering;
|
||||
use App\Models\User;
|
||||
|
||||
class CateringPolicy
|
||||
{
|
||||
public function update(User $user, EventCatering $catering): bool
|
||||
{
|
||||
return $user->id === $catering->user_id || $user->isAdmin();
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
19
app/Policies/CommentPolicy.php
Executable file
19
app/Policies/CommentPolicy.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Comment;
|
||||
use App\Models\User;
|
||||
|
||||
class CommentPolicy
|
||||
{
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delete(User $user, Comment $comment): bool
|
||||
{
|
||||
return $user->isAdmin();
|
||||
}
|
||||
}
|
||||
39
app/Policies/EventPolicy.php
Executable file
39
app/Policies/EventPolicy.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Enums\EventStatus;
|
||||
use App\Models\Event;
|
||||
use App\Models\User;
|
||||
|
||||
class EventPolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function view(User $user, Event $event): bool
|
||||
{
|
||||
if ($event->status === EventStatus::Draft) {
|
||||
return $user->isAdmin();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->isAdmin();
|
||||
}
|
||||
|
||||
public function update(User $user, Event $event): bool
|
||||
{
|
||||
return $user->isAdmin();
|
||||
}
|
||||
|
||||
public function delete(User $user, Event $event): bool
|
||||
{
|
||||
return $user->isAdmin();
|
||||
}
|
||||
}
|
||||
22
app/Policies/ParticipantPolicy.php
Executable file
22
app/Policies/ParticipantPolicy.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ParticipantPolicy
|
||||
{
|
||||
public function update(User $user, EventParticipant $participant): bool
|
||||
{
|
||||
if ($user->isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return DB::table('parent_player')
|
||||
->where('parent_id', $user->id)
|
||||
->where('player_id', $participant->player_id)
|
||||
->exists();
|
||||
}
|
||||
}
|
||||
19
app/Policies/TimekeeperPolicy.php
Normal file
19
app/Policies/TimekeeperPolicy.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\EventTimekeeper;
|
||||
use App\Models\User;
|
||||
|
||||
class TimekeeperPolicy
|
||||
{
|
||||
public function update(User $user, EventTimekeeper $timekeeper): bool
|
||||
{
|
||||
return $user->id === $timekeeper->user_id || $user->isAdmin();
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user