<?php

namespace App\Models\Concerns;

trait InteractsWithNova
{
    /**
     * Check if user can access nova
     */
    public function canAccessNova(): bool
    {
        if ($this->isMe()) {
            return true;
        }

        if ($this->hasRole(['admin', 'manager'])) {
            return true;
        }

        if ($this->hasRole('vendor') && $this->channel()->id) {
            return true;
        }

        return false;
    }
}
