<?php

namespace App\Policies;

use App\Models\Mikrotik;
use App\Models\User;

class MikrotikPolicy
{
    public function before(User $user, $ability)
    {
        if ($user->hasRole('Super Admin')) {
            return true;
        }
    }

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

    public function view(User $user, Mikrotik $mikrotik): bool
    {
        return $user->can('mikrotik.view');
    }

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

    public function update(User $user, Mikrotik $mikrotik): bool
    {
        return $user->can('mikrotik.update');
    }

    public function delete(User $user, Mikrotik $mikrotik): bool
    {
        return $user->can('mikrotik.delete');
    }

    public function restore(User $user, Mikrotik $mikrotik): bool
    {
        return false;
    }

    public function forceDelete(User $user, Mikrotik $mikrotik): bool
    {
        return false;
    }
}
