userrights newsletter

This commit is contained in:
salam committed 2026-05-05 12:12:02 +02:00
1 parent 2514349783
commit 7e8fa02ded
6 files changed
+207 -209

No files matched your search

@@ -3,12 +3,15 @@
namespace App\Filament\Clusters\Administration;
use BackedEnum;
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
use Filament\Clusters\Cluster;
use Filament\Pages\Enums\SubNavigationPosition;
use Filament\Support\Icons\Heroicon;
class AdministrationCluster extends Cluster
{
use HasPageShield;
protected static string|BackedEnum|null $navigationIcon = Heroicon::AdjustmentsHorizontal;
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Start;
@@ -3,12 +3,15 @@
namespace App\Filament\Clusters\Newsletter;
use BackedEnum;
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
use Filament\Clusters\Cluster;
use Filament\Pages\Enums\SubNavigationPosition;
use Filament\Support\Icons\Heroicon;
class NewsletterCluster extends Cluster
{
use HasPageShield;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedEnvelope;
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
@@ -8,6 +8,7 @@ use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules\Password;
class UserForm
@@ -39,20 +40,26 @@ class UserForm
->prefixIcon('phosphor-envelope')
->label('E-Mail'),
TextInput::make('password')
->prefixIcon('phosphor-lock')
->label('Passwort')
->password() // Masks the input
->required()
->password()
->revealable()
->rule(Password::min(8)->mixedCase()->numbers()->symbols()->uncompromised()) // Enforces strong password policies
->dehydrateStateUsing(fn ($state) => bcrypt($state)) // Hashes the password before saving
->prefixIcon('phosphor-lock')
->dehydrated(fn ($state): bool => filled($state))
->dehydrateStateUsing(fn ($state): string => Hash::make($state))
->same('password_confirmation')
->rule(Password::min(8)
->mixedCase()
->numbers()
->symbols()
->uncompromised())
->label('Password'),
TextInput::make('password_confirmation')
->label('Passwort Bestätigen')
->prefixIcon('phosphor-lock')
->password() // Masks the input
->required()
->same('password') // Validates that this matches the 'password' field
->label('Passwort Bestätigen'),
->password()
->dehydrated(false)
->same('password')
->revealable(),
Checkbox::make('agb_akzeptiert')
->default(false)
->label('Allgemeinen Geschäftsbedinnungen akzeptieren')
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\MailAdressen;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class MailAddressePolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, MailAdressen $mailAdressen): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, MailAdressen $mailAdressen): bool
{
return false;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, MailAdressen $mailAdressen): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, MailAdressen $mailAdressen): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, MailAdressen $mailAdressen): bool
{
return false;
}
}