Files
fewo-stommer/app/Policies/UserPolicy.php
T
Lars StommerandClaude Opus 5.5 27ea12901e Benutzerrollen (Administrator, Vermietung, Inhalte) und Benutzerverwaltung
- Rollenbasierte Policies, Navigationsgruppen
- Media Library (Spatie) für die kommende Bildverwaltung installiert

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:13:55 +02:00

22 lines
387 B
PHP

<?php
namespace App\Policies;
use App\Models\User;
/**
* Only administrators manage accounts; nobody can delete their own account.
*/
class UserPolicy extends RolePolicy
{
protected function roles(): array
{
return [];
}
public function delete(User $user, ?User $model = null): bool
{
return $this->allows($user) && ! $user->is($model);
}
}