<?php

namespace App\Policies;

use App\Models\User;

class StaffPolicy
{
    public function viewAny(User $user): bool
    {
        return $user->can('user.manage');
    }

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

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

    public function update(User $user, User $staff): bool
    {
        return $user->can('user.manage') && ($user->hasRole('Super Admin') || ! $staff->hasRole('Super Admin'));
    }

    public function delete(User $user, User $staff): bool
    {
        return $user->can('user.manage') && $user->id !== $staff->id && ! $staff->hasRole('Super Admin');
    }

    public function restore(User $user, User $staff): bool
    {
        return $user->can('user.manage');
    }

    public function forceDelete(User $user, User $staff): bool
    {
        return $user->can('user.manage');
    }
}
