<?php

namespace App\Policies;

use App\Models\Note;
use App\Models\User\User;

class NotePolicy {
    public function view(User $user) {
        return $user->can('notes.view');
    }

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

    public function delete(User $user, Note $note) {
        if ($note->is_primary) return $user->can('notes.primary.delete');
        return $user->can('notes.delete');
    }
}
