2024-05-28 17:19:36 -04:00
|
|
|
<?php
|
|
|
|
|
2025-01-30 00:23:55 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-05-28 17:19:36 -04:00
|
|
|
namespace App\Policies;
|
|
|
|
|
|
|
|
use App\Models\Mod;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
class ModPolicy
|
|
|
|
{
|
|
|
|
/**
|
2024-07-20 13:28:38 -04:00
|
|
|
* Determine whether the user can view multiple models.
|
2024-05-28 17:19:36 -04:00
|
|
|
*/
|
2024-08-02 12:23:05 -04:00
|
|
|
public function viewAny(?User $user): bool
|
2024-05-28 17:19:36 -04:00
|
|
|
{
|
2024-08-02 12:23:05 -04:00
|
|
|
return true;
|
2024-05-28 17:19:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-07-20 13:28:38 -04:00
|
|
|
* Determine whether the user can view a specific model.
|
2024-05-28 17:19:36 -04:00
|
|
|
*/
|
|
|
|
public function view(?User $user, Mod $mod): bool
|
|
|
|
{
|
|
|
|
// Everyone can view mods.
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether the user can create models.
|
|
|
|
*/
|
|
|
|
public function create(User $user): bool
|
|
|
|
{
|
2024-05-31 17:44:52 -04:00
|
|
|
return false;
|
2024-05-28 17:19:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether the user can update the model.
|
|
|
|
*/
|
|
|
|
public function update(User $user, Mod $mod): bool
|
|
|
|
{
|
2024-05-31 17:44:52 -04:00
|
|
|
return false;
|
2024-05-28 17:19:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether the user can delete the model.
|
|
|
|
*/
|
|
|
|
public function delete(User $user, Mod $mod): bool
|
|
|
|
{
|
2024-05-31 17:44:52 -04:00
|
|
|
return false;
|
2024-05-28 17:19:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether the user can restore the model.
|
|
|
|
*/
|
|
|
|
public function restore(User $user, Mod $mod): bool
|
|
|
|
{
|
2024-05-31 17:44:52 -04:00
|
|
|
return false;
|
2024-05-28 17:19:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether the user can permanently delete the model.
|
|
|
|
*/
|
|
|
|
public function forceDelete(User $user, Mod $mod): bool
|
|
|
|
{
|
2024-05-31 17:44:52 -04:00
|
|
|
return false;
|
2024-05-28 17:19:36 -04:00
|
|
|
}
|
|
|
|
}
|