<?php
// GET /api/permissions

if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
    sendError('Method not allowed', 405);
}

$db   = getDB();
$rows = $db->query("SELECT id, name FROM permissions ORDER BY id ASC")->fetch_all(MYSQLI_ASSOC);
$db->close();

sendSuccess(['data' => $rows]);
