Files
Virtnet.bond/app/Policies/CurrencyPolicy.php
2025-11-30 11:57:22 +01:00

58 lines
1.3 KiB
PHP

<?php
namespace App\Policies;
use App\Models\Currency;
use App\Models\User;
class CurrencyPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->hasPermission('admin.currencies.viewAny');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Currency $currency): bool
{
return $user->hasPermission('admin.currencies.view');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->hasPermission('admin.currencies.create');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Currency $currency): bool
{
return $user->hasPermission('admin.currencies.update');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Currency $currency): bool
{
return $user->hasPermission('admin.currencies.delete');
}
/**
* Determine whether the user can delete any models.
*/
public function deleteAny(User $user): bool
{
return $user->hasPermission('admin.currencies.deleteAny');
}
}