<?php

namespace App\Policies;

use App\Models\User;
use App\Models\Book;

class BookPolicy
{
    public function view(User $user, Book $book): bool
    {
        return $book->principaluri === 'principals/' . $user->email;
    }

    public function update(User $user, Book $book): bool
    {
        return $book->principaluri === 'principals/' . $user->email;
    }

    public function delete(User $user, Book $book): bool
    {
        return $book->principaluri === 'principals/' . $user->email;
    }

    public function share(User $user, Book $book): bool
    {
        // Placeholder for future sharing logic
        return $book->principaluri === 'principals/' . $user->email;
    }
}
