<?php

namespace App\Policies;

use App\Models\OnlineStatus;
use App\Models\User;

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

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

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

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

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

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

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

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