<?php

declare(strict_types=1);

namespace Builder\Core\Foundation\Definition\Concerns;

trait HasPermissions
{
    private ?string $viewPermission = null;

    private ?string $updatePermission = null;

    public function canView(?string $permission): self
    {
        $this->viewPermission = $permission;

        return $this;
    }

    public function canUpdate(?string $permission): self
    {
        $this->updatePermission = $permission;

        return $this;
    }

    public function getViewPermission(): ?string
    {
        return $this->viewPermission;
    }

    public function getUpdatePermission(): ?string
    {
        return $this->updatePermission;
    }
}
