<?php

namespace Modules\User\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Modules\User\Entities\Bank;

class BankPolicy
{
    use HandlesAuthorization;

    public function viewAny($user): bool
    {
        return true;
    }

    public function view($user, ?Bank $bank = null): bool
    {
        return true;
    }

    public function create($user): bool
    {
        return $user->hasPermissionTo('tambah bank');
    }

    public function update($user, ?Bank $bank = null): bool
    {
        return $user->hasPermissionTo('kemaskini bank');
    }

    public function deleteAny($user): bool
    {
        return $user->hasPermissionTo('hapus bank');
    }

    public function delete($user, ?Bank $bank = null): bool
    {
        return $user->hasPermissionTo('hapus bank');
    }
}
