<?php

namespace Modules\ActivityLog\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use Spatie\Activitylog\Models\Activity;

class ActivityLogPolicy
{
    use HandlesAuthorization;

    /**
     * Determine whether the user can view any models.
     */
    public function viewAny($user): bool
    {
        return $user->hasPermissionTo('lihat log aktiviti');
    }

    /**
     * Determine whether the user can view the model.
     */
    public function view($user, ?Activity $activity = null): bool
    {
        return $user->hasPermissionTo('lihat log aktiviti');
    }
}
