layer-chicken/app/Policies/EggCollectionPolicy.php

70 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Policies;
use App\Models\EggCollection;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class EggCollectionPolicy
{
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:EggCollection');
}
public function view(AuthUser $authUser, EggCollection $eggCollection): bool
{
return $authUser->can('View:EggCollection');
}
public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:EggCollection');
}
public function update(AuthUser $authUser, EggCollection $eggCollection): bool
{
return $authUser->can('Update:EggCollection');
}
public function delete(AuthUser $authUser, EggCollection $eggCollection): bool
{
return $authUser->can('Delete:EggCollection');
}
public function restore(AuthUser $authUser, EggCollection $eggCollection): bool
{
return $authUser->can('Restore:EggCollection');
}
public function forceDelete(AuthUser $authUser, EggCollection $eggCollection): bool
{
return $authUser->can('ForceDelete:EggCollection');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:EggCollection');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:EggCollection');
}
public function replicate(AuthUser $authUser, EggCollection $eggCollection): bool
{
return $authUser->can('Replicate:EggCollection');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:EggCollection');
}
}