<?php

namespace App\Modules\Operations\Policies;

use App\Models\User;
use App\Modules\Operations\Models\OperationalControlEvent;

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

    public function acknowledge(User $user, OperationalControlEvent $event): bool
    {
        if (! $user->can('operations.control.manage')) {
            return false;
        }

        return (int) $event->tenant_id === (int) $user->tenant_id;
    }
}
