<?php

namespace App\Policies;

use App\Models\User;
use App\Models\Subscription;

class SubscriptionPolicy
{
    public function before(User $user, $ability)
    {
        if ($user->isAdmin()) return true;
    }

    public function view(User $user, Subscription $subscription)
    {
        return $user->id === $subscription->user_id;
    }

    public function update(User $user, Subscription $subscription)
    {
        return $user->id === $subscription->user_id;
    }
}
