<?php
namespace OxygenApp\Common\Permissions;

if (!defined('ABSPATH')) exit;

use OxygenApp\Utils\UserUtil;

class RestPermissions {

    /**
     * Permission callback for public endpoints (no authentication required)
     * Used for: user registration, login, activation, password reset requests, Google auth
     */
    public static function allowPublic(): bool {
        return true;
    }

    /**
     * Permission callback for endpoints that require an authenticated user
     * Used for: playlist operations, user profile updates, account deletion
     */
    public static function isLoggedIn(): bool {
        return UserUtil::isLoggedIn();
    }

    /**
     * Permission callback for endpoints that can work with or without authentication
     * Used for: logout, language settings
     */
    public static function allowAll(): bool {
        return true;
    }
}
