fix policies

This commit is contained in:
salam committed 2026-07-12 12:35:52 +02:00
1 parent 109907d1f3
commit f8e6f8183b
10 files changed
+359 -318

No files matched your search

+38 -38
View File
@@ -2,65 +2,65 @@
namespace App\Policies;
use App\Models\SofaScoreTask;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class SofaScoreTaskPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:SofaScoreTask');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, SofaScoreTask $sofaScoreTask): bool
public function view(AuthUser $authUser): bool
{
return false;
return $authUser->can('View:SofaScoreTask');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:SofaScoreTask');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, SofaScoreTask $sofaScoreTask): bool
public function update(AuthUser $authUser): bool
{
return false;
return $authUser->can('Update:SofaScoreTask');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, SofaScoreTask $sofaScoreTask): bool
public function delete(AuthUser $authUser): bool
{
return false;
return $authUser->can('Delete:SofaScoreTask');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, SofaScoreTask $sofaScoreTask): bool
public function restore(AuthUser $authUser): bool
{
return false;
return $authUser->can('Restore:SofaScoreTask');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, SofaScoreTask $sofaScoreTask): bool
public function forceDelete(AuthUser $authUser): bool
{
return false;
return $authUser->can('ForceDelete:SofaScoreTask');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:SofaScoreTask');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:SofaScoreTask');
}
public function replicate(AuthUser $authUser): bool
{
return $authUser->can('Replicate:SofaScoreTask');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:SofaScoreTask');
}
}
+38 -38
View File
@@ -2,65 +2,65 @@
namespace App\Policies;
use App\Models\SofaScoreTournament;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class SofaScoreTournamentPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:SofaScoreTournament');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, SofaScoreTournament $sofaScoreTournament): bool
public function view(AuthUser $authUser): bool
{
return false;
return $authUser->can('View:SofaScoreTournament');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:SofaScoreTournament');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, SofaScoreTournament $sofaScoreTournament): bool
public function update(AuthUser $authUser): bool
{
return false;
return $authUser->can('Update:SofaScoreTournament');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, SofaScoreTournament $sofaScoreTournament): bool
public function delete(AuthUser $authUser): bool
{
return false;
return $authUser->can('Delete:SofaScoreTournament');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, SofaScoreTournament $sofaScoreTournament): bool
public function restore(AuthUser $authUser): bool
{
return false;
return $authUser->can('Restore:SofaScoreTournament');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, SofaScoreTournament $sofaScoreTournament): bool
public function forceDelete(AuthUser $authUser): bool
{
return false;
return $authUser->can('ForceDelete:SofaScoreTournament');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:SofaScoreTournament');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:SofaScoreTournament');
}
public function replicate(AuthUser $authUser): bool
{
return $authUser->can('Replicate:SofaScoreTournament');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:SofaScoreTournament');
}
}
+39 -38
View File
@@ -2,65 +2,66 @@
namespace App\Policies;
use App\Models\StatisticFixtures;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class StatisticFixturesPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:StatisticFixtures');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, StatisticFixtures $statisticFixtures): bool
public function view(AuthUser $authUser): bool
{
return false;
return $authUser->can('View:StatisticFixtures');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:StatisticFixtures');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, StatisticFixtures $statisticFixtures): bool
public function update(AuthUser $authUser): bool
{
return false;
return $authUser->can('Update:StatisticFixtures');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, StatisticFixtures $statisticFixtures): bool
public function delete(AuthUser $authUser): bool
{
return false;
return $authUser->can('Delete:StatisticFixtures');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, StatisticFixtures $statisticFixtures): bool
public function restore(AuthUser $authUser): bool
{
return false;
return $authUser->can('Restore:StatisticFixtures');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, StatisticFixtures $statisticFixtures): bool
public function forceDelete(AuthUser $authUser): bool
{
return false;
return $authUser->can('ForceDelete:StatisticFixtures');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:StatisticFixtures');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:StatisticFixtures');
}
public function replicate(AuthUser $authUser): bool
{
return $authUser->can('Replicate:StatisticFixtures');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:StatisticFixtures');
}
}
+39 -38
View File
@@ -2,65 +2,66 @@
namespace App\Policies;
use App\Models\StatistikoDetail;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class StatistikoDetailPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:StatistikoDetail');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, StatistikoDetail $statistikoDetail): bool
public function view(AuthUser $authUser): bool
{
return false;
return $authUser->can('View:StatistikoDetail');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:StatistikoDetail');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, StatistikoDetail $statistikoDetail): bool
public function update(AuthUser $authUser): bool
{
return false;
return $authUser->can('Update:StatistikoDetail');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, StatistikoDetail $statistikoDetail): bool
public function delete(AuthUser $authUser): bool
{
return false;
return $authUser->can('Delete:StatistikoDetail');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, StatistikoDetail $statistikoDetail): bool
public function restore(AuthUser $authUser): bool
{
return false;
return $authUser->can('Restore:StatistikoDetail');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, StatistikoDetail $statistikoDetail): bool
public function forceDelete(AuthUser $authUser): bool
{
return false;
return $authUser->can('ForceDelete:StatistikoDetail');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:StatistikoDetail');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:StatistikoDetail');
}
public function replicate(AuthUser $authUser): bool
{
return $authUser->can('Replicate:StatistikoDetail');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:StatistikoDetail');
}
}
+39 -38
View File
@@ -2,65 +2,66 @@
namespace App\Policies;
use App\Models\StatistikoEvent;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class StatistikoEventPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:StatistikoEvent');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, StatistikoEvent $statistikoEvent): bool
public function view(AuthUser $authUser): bool
{
return false;
return $authUser->can('View:StatistikoEvent');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:StatistikoEvent');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, StatistikoEvent $statistikoEvent): bool
public function update(AuthUser $authUser): bool
{
return false;
return $authUser->can('Update:StatistikoEvent');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, StatistikoEvent $statistikoEvent): bool
public function delete(AuthUser $authUser): bool
{
return false;
return $authUser->can('Delete:StatistikoEvent');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, StatistikoEvent $statistikoEvent): bool
public function restore(AuthUser $authUser): bool
{
return false;
return $authUser->can('Restore:StatistikoEvent');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, StatistikoEvent $statistikoEvent): bool
public function forceDelete(AuthUser $authUser): bool
{
return false;
return $authUser->can('ForceDelete:StatistikoEvent');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:StatistikoEvent');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:StatistikoEvent');
}
public function replicate(AuthUser $authUser): bool
{
return $authUser->can('Replicate:StatistikoEvent');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:StatistikoEvent');
}
}
+39 -38
View File
@@ -2,65 +2,66 @@
namespace App\Policies;
use App\Models\StatistikoImport;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class StatistikoImportPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:StatistikoImport');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, StatistikoImport $statistikoImport): bool
public function view(AuthUser $authUser): bool
{
return false;
return $authUser->can('View:StatistikoImport');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:StatistikoImport');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, StatistikoImport $statistikoImport): bool
public function update(AuthUser $authUser): bool
{
return false;
return $authUser->can('Update:StatistikoImport');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, StatistikoImport $statistikoImport): bool
public function delete(AuthUser $authUser): bool
{
return false;
return $authUser->can('Delete:StatistikoImport');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, StatistikoImport $statistikoImport): bool
public function restore(AuthUser $authUser): bool
{
return false;
return $authUser->can('Restore:StatistikoImport');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, StatistikoImport $statistikoImport): bool
public function forceDelete(AuthUser $authUser): bool
{
return false;
return $authUser->can('ForceDelete:StatistikoImport');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:StatistikoImport');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:StatistikoImport');
}
public function replicate(AuthUser $authUser): bool
{
return $authUser->can('Replicate:StatistikoImport');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:StatistikoImport');
}
}
+39 -38
View File
@@ -2,65 +2,66 @@
namespace App\Policies;
use App\Models\StatistikoPlayer;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
class StatistikoPlayerPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:StatistikoPlayer');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, StatistikoPlayer $statistikoPlayer): bool
public function view(AuthUser $authUser): bool
{
return false;
return $authUser->can('View:StatistikoPlayer');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:StatistikoPlayer');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, StatistikoPlayer $statistikoPlayer): bool
public function update(AuthUser $authUser): bool
{
return false;
return $authUser->can('Update:StatistikoPlayer');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, StatistikoPlayer $statistikoPlayer): bool
public function delete(AuthUser $authUser): bool
{
return false;
return $authUser->can('Delete:StatistikoPlayer');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, StatistikoPlayer $statistikoPlayer): bool
public function restore(AuthUser $authUser): bool
{
return false;
return $authUser->can('Restore:StatistikoPlayer');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, StatistikoPlayer $statistikoPlayer): bool
public function forceDelete(AuthUser $authUser): bool
{
return false;
return $authUser->can('ForceDelete:StatistikoPlayer');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:StatistikoPlayer');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:StatistikoPlayer');
}
public function replicate(AuthUser $authUser): bool
{
return $authUser->can('Replicate:StatistikoPlayer');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:StatistikoPlayer');
}
}