<?php

namespace App\Policies;

use App\Models\ToothRecord;
use App\Models\User;

class ToothRecordPolicy
{
    public function viewAny(User $user): bool
    {
        return $user->can('chart.view');
    }

    public function create(User $user): bool
    {
        return $user->can('chart.manage');
    }

    public function delete(User $user, ToothRecord $record): bool
    {
        return $user->can('chart.manage') && $record->tenant_id === $user->tenant_id;
    }
}
