<?php
include '../db.php';

$name = trim($_POST['right_name']);
$description = trim($_POST['right_description'] ?? '');

if (!empty($name)) {
    $stmt = $conn->prepare("INSERT INTO rights (name, description) VALUES (?, ?)");
    $stmt->bind_param("ss", $name, $description);
    $stmt->execute();
    $stmt->close();
}

header("Location: ../user_rights.php");
exit;
