forge/app/Policies/ModPolicy.php

69 lines
1.3 KiB
PHP
Raw Permalink Normal View History

<?php
2025-01-30 00:23:55 -05:00
declare(strict_types=1);
namespace App\Policies;
use App\Models\Mod;
use App\Models\User;
class ModPolicy
{
/**
* Determine whether the user can view multiple models.
*/
2024-08-02 12:23:05 -04:00
public function viewAny(?User $user): bool
{
2024-08-02 12:23:05 -04:00
return true;
}
/**
* Determine whether the user can view a specific model.
*/
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
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Mod $mod): bool
{
return false;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Mod $mod): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Mod $mod): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Mod $mod): bool
{
return false;
}
}