<?php

namespace App\Modules\HR\Organization\Policies;

use App\Models\User;

abstract class OrganizationPolicy
{
    abstract protected function abilityPrefix(): string;

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

    public function view(User $user): bool
    {
        return $user->can($this->abilityPrefix().'.view');
    }

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

    public function update(User $user): bool
    {
        return $user->can($this->abilityPrefix().'.update');
    }

    public function deactivate(User $user): bool
    {
        return $user->can($this->abilityPrefix().'.deactivate');
    }
}
