This commit is contained in:
salam committed 2025-09-07 19:05:29 +02:00
1 parent b005c7677e
commit 59eea97d5a
21 files changed
+597 -779

No files matched your search

+27 -65
View File
@@ -1,108 +1,70 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use App\Models\User;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\Kontooptionen;
use Illuminate\Auth\Access\HandlesAuthorization;
class KontooptionenPolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
public function viewAny(AuthUser $authUser): bool
{
return $user->can('view_any_kontooptionens::kontooptionen');
return $authUser->can('ViewAny:Kontooptionen');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Kontooptionen $kontooptionen): bool
public function view(AuthUser $authUser, Kontooptionen $kontooptionen): bool
{
return $user->can('view_kontooptionens::kontooptionen');
return $authUser->can('View:Kontooptionen');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return $user->can('create_kontooptionens::kontooptionen');
return $authUser->can('Create:Kontooptionen');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Kontooptionen $kontooptionen): bool
public function update(AuthUser $authUser, Kontooptionen $kontooptionen): bool
{
return $user->can('update_kontooptionens::kontooptionen');
return $authUser->can('Update:Kontooptionen');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Kontooptionen $kontooptionen): bool
public function delete(AuthUser $authUser, Kontooptionen $kontooptionen): bool
{
return $user->can('delete_kontooptionens::kontooptionen');
return $authUser->can('Delete:Kontooptionen');
}
/**
* Determine whether the user can bulk delete.
*/
public function deleteAny(User $user): bool
public function restore(AuthUser $authUser, Kontooptionen $kontooptionen): bool
{
return $user->can('delete_any_kontooptionens::kontooptionen');
return $authUser->can('Restore:Kontooptionen');
}
/**
* Determine whether the user can permanently delete.
*/
public function forceDelete(User $user, Kontooptionen $kontooptionen): bool
public function forceDelete(AuthUser $authUser, Kontooptionen $kontooptionen): bool
{
return $user->can('force_delete_kontooptionens::kontooptionen');
return $authUser->can('ForceDelete:Kontooptionen');
}
/**
* Determine whether the user can permanently bulk delete.
*/
public function forceDeleteAny(User $user): bool
public function forceDeleteAny(AuthUser $authUser): bool
{
return $user->can('force_delete_any_kontooptionens::kontooptionen');
return $authUser->can('ForceDeleteAny:Kontooptionen');
}
/**
* Determine whether the user can restore.
*/
public function restore(User $user, Kontooptionen $kontooptionen): bool
public function restoreAny(AuthUser $authUser): bool
{
return $user->can('restore_kontooptionens::kontooptionen');
return $authUser->can('RestoreAny:Kontooptionen');
}
/**
* Determine whether the user can bulk restore.
*/
public function restoreAny(User $user): bool
public function replicate(AuthUser $authUser, Kontooptionen $kontooptionen): bool
{
return $user->can('restore_any_kontooptionens::kontooptionen');
return $authUser->can('Replicate:Kontooptionen');
}
/**
* Determine whether the user can replicate.
*/
public function replicate(User $user, Kontooptionen $kontooptionen): bool
public function reorder(AuthUser $authUser): bool
{
return $user->can('replicate_kontooptionens::kontooptionen');
return $authUser->can('Reorder:Kontooptionen');
}
/**
* Determine whether the user can reorder.
*/
public function reorder(User $user): bool
{
return $user->can('reorder_kontooptionens::kontooptionen');
}
}
}